0001   0000                    output "deleteme.bin"
0002   0000             ; Game engine code --------------------------------------------------------------
0003   0000             
0004   0000             ; Arcade Game Designer.
0005   0000             ; (C) 2008 - 2019 Jonathan Cauldwell.
0006   0000             ; Timex Sinclair Engine v0.7.5.
0007   0000             
0008   0000             ; Global definitions.
0009   0000             
0010   0000             SIMASK equ 248             ; SPRITEINK mask - default to just INK.
0011   0000             SHRAPN equ 63926           ; shrapnel table, just below screen address table.
0012   0000             SCADTB equ 64256           ; screen address table, just below map.
0013   0000             MAP    equ 22528           ; properties map buffer.
0014   0000             loopa  equ 23681           ; loop counter system variable.
0015   0000             loopb  equ 23728           ; loop counter system variable.
0016   0000             loopc  equ 23729           ; loop counter system variable.
0017   0000             
0018   0000             ; Block characteristics.
0019   0000             
0020   0000             PLATFM equ 1               ; platform.
0021   0000             WALL   equ PLATFM + 1      ; solid wall.
0022   0000             LADDER equ WALL + 1        ; ladder.
0023   0000             FODDER equ LADDER + 1      ; fodder block.
0024   0000             DEADLY equ FODDER + 1      ; deadly block.
0025   0000             CUSTOM equ DEADLY + 1      ; custom block.
0026   0000             WATER  equ CUSTOM + 1      ; water block.
0027   0000             COLECT equ WATER + 1       ; collectable block.
0028   0000             NUMTYP equ COLECT + 1      ; number of types.
0029   0000             
0030   0000             ; Sprites.
0031   0000             
0032   0000             NUMSPR equ 12              ; number of sprites.
0033   0000             TABSIZ equ 17              ; size of each entry.
0034   0000             SPRBUF equ NUMSPR * TABSIZ ; size of entire table.
0035   0000             NMESIZ equ 4               ; bytes stored in nmetab for each sprite.
0036   0000             X      equ 8               ; new x coordinate of sprite.
0037   0000             Y      equ X + 1           ; new y coordinate of sprite.
0038   0000             PAM1ST equ 5               ; first sprite parameter, old x (ix+5).
0039   0000             
0040   0000             ; Particle engine.
0041   0000             
0042   0000             NUMSHR equ 55              ; pieces of shrapnel.
0043   0000             SHRSIZ equ 6               ; bytes per particle.
0044   0000             
0045   0000             
0046   0000             ; Game starts here --------------------------------------------------------------
0047   0000             
0048   0000             ; We'll put the code after the Timex attribute screen with plenty of room for the stack
0049   0000             
0050   0000                    org 32000
0051   7D00             
0052   7D00             start  equ $
0053   7D00             
0054   7D00             ; Set up the font.
0055   7D00             
0056   7D00 21 8F C8           ld hl,font-256      ; address of font.
0057   7D03 22 36 5C           ld (23606),hl       ; set up game font.
0058   7D06 C3 36 83           jp game             ; start the game.
0059   7D09             
0060   7D09 00          joyval defb 0              ; joystick reading.
0061   7D0A 00          frmno  defb 0              ; selected frame.
0062   7D0B             
0063   7D0B             ; Don't change the order of these four.  Menu routine relies on winlft following wintop.
0064   7D0B             
0065   7D0B 01          wintop defb WINDOWTOP      ; top of window.
0066   7D0C 01          winlft defb WINDOWLFT      ; left edge.
0067   7D0D 16          winhgt defb WINDOWHGT      ; window height.
0068   7D0E 1E          winwid defb WINDOWWID      ; window width.
0069   7D0F             
0070   7D0F 0A          numob  defb NUMOBJ         ; number of objects in game.
0071   7D10             
0072   7D10             ; Variables start here.
0073   7D10             ; Pixel versions of wintop, winlft, winhgt, winwid.
0074   7D10             
0075   7D10 08          wntopx defb (8 * WINDOWTOP)
0076   7D11 08          wnlftx defb (8 * WINDOWLFT)
0077   7D12 A8          wnbotx defb ((WINDOWTOP * 8) + (WINDOWHGT * 8) - 16)
0078   7D13 E8          wnrgtx defb ((WINDOWLFT * 8) + (WINDOWWID * 8) - 16)
0079   7D14 00          scno   defb 0              ; present screen number.
0080   7D15 03          numlif defb 3              ; number of lives.
0081   7D16 00          vara   defb 0              ; general-purpose variable.
0082   7D17 00          varb   defb 0              ; general-purpose variable.
0083   7D18 00          varc   defb 0              ; general-purpose variable.
0084   7D19 00          vard   defb 0              ; general-purpose variable.
0085   7D1A 00          vare   defb 0              ; general-purpose variable.
0086   7D1B 00          varf   defb 0              ; general-purpose variable.
0087   7D1C 00          varg   defb 0              ; general-purpose variable.
0088   7D1D 00          varh   defb 0              ; general-purpose variable.
0089   7D1E 00          vari   defb 0              ; general-purpose variable.
0090   7D1F 00          varj   defb 0              ; general-purpose variable.
0091   7D20 00          vark   defb 0              ; general-purpose variable.
0092   7D21 00          varl   defb 0              ; general-purpose variable.
0093   7D22 00          varm   defb 0              ; general-purpose variable.
0094   7D23 00          varn   defb 0              ; general-purpose variable.
0095   7D24 00          varo   defb 0              ; general-purpose variable.
0096   7D25 00          varp   defb 0              ; general-purpose variable.
0097   7D26 00          varq   defb 0              ; general-purpose variable.
0098   7D27 00          varr   defb 0              ; general-purpose variable.
0099   7D28 00          vars   defb 0              ; general-purpose variable.
0100   7D29 00          vart   defb 0              ; general-purpose variable.
0101   7D2A 00          varu   defb 0              ; general-purpose variable.
0102   7D2B 00          varv   defb 0              ; general-purpose variable.
0103   7D2C 00          varw   defb 0              ; general-purpose variable.
0104   7D2D 00          varz   defb 0              ; general-purpose variable.
0105   7D2E 00          contrl defb 0              ; control, 0 = keyboard, 1 = Kempston, 2 = Sinclair, 3 = Mouse.
0106   7D2F 00          charx  defb 0              ; cursor x position.
0107   7D30 00          chary  defb 0              ; cursor y position.
0108   7D31 00          clock  defb 0              ; last clock reading.
0109   7D32 FF          varrnd defb 255            ; last random number.
0110   7D33 FE          varobj defb 254            ; last object number.
0111   7D34 FF          varopt defb 255            ; last option chosen from menu.
0112   7D35 FF          varblk defb 255            ; block type.
0113   7D36 00          nexlev defb 0              ; next level flag.
0114   7D37 00          restfl defb 0              ; restart screen flag.
0115   7D38 00          deadf  defb 0              ; dead flag.
0116   7D39 00          gamwon defb 0              ; game won flag.
0117   7D3A 00          dispx  defb 0              ; cursor x position.
0118   7D3B 00          dispy  defb 0              ; cursor y position.
0119   7D3C             
0120   7D3C             ; Make sure pointers are arranged in the same order as the data itself.
0121   7D3C             
0122   7D3C 75 A2       frmptr defw frmlst         ; sprite frames.
0123   7D3E             
0124   7D3E             ; Assorted game routines which can go in contended memory.
0125   7D3E             
0126   7D3E             ; Modify for inventory.
0127   7D3E             
0128   7D3E 21 B0 7E    minve  ld hl,invdis        ; routine address.
0129   7D41 22 C9 7D           ld (mod0+1),hl      ; set up menu routine.
0130   7D44 22 6F 7D           ld (mod2+1),hl      ; set up count routine.
0131   7D47 21 BD 7E           ld hl,fopt          ; find option from available objects.
0132   7D4A 22 43 7E           ld (mod1+1),hl      ; set up routine.
0133   7D4D 18 0F              jr dbox             ; do menu routine.
0134   7D4F             
0135   7D4F             ; Modify for menu.
0136   7D4F             
0137   7D4F 21 25 8A    mmenu  ld hl,always        ; routine address.
0138   7D52 22 C9 7D           ld (mod0+1),hl      ; set up routine.
0139   7D55 22 6F 7D           ld (mod2+1),hl      ; set up count routine.
0140   7D58 21 72 7E           ld hl,fstd          ; standard option selection.
0141   7D5B 22 43 7E           ld (mod1+1),hl      ; set up routine.
0142   7D5E             
0143   7D5E             ; Drop through into box routine.
0144   7D5E             
0145   7D5E             ; Work out size of box for message or menu.
0146   7D5E             
0147   7D5E             ;dbox   ld hl,nummsg        ; total messages.
0148   7D5E             ;       cp (hl)             ; does this one exist?
0149   7D5E             ;       ret nc              ; no, nothing to display.
0150   7D5E 21 4C 94    dbox   ld hl,msgdat        ; pointer to messages.
0151   7D61 CD 90 8C           call getwrd         ; get message number.
0152   7D64 E5                 push hl             ; store pointer to message.
0153   7D65 16 01              ld d,1              ; height.
0154   7D67 AF                 xor a               ; start at object zero.
0155   7D68 32 6F 89           ld (combyt),a       ; store number of object in combyt.
0156   7D6B 5F                 ld e,a              ; maximum width.
0157   7D6C 06 00       dbox5  ld b,0              ; this line's width.
0158   7D6E CD 25 8A    mod2   call always         ; item in player's possession?
0159   7D71 20 01              jr nz,dbox6         ; not in inventory, skip this line.
0160   7D73 14                 inc d               ; add to tally.
0161   7D74 7E          dbox6  ld a,(hl)           ; get character.
0162   7D75 23                 inc hl              ; next character.
0163   7D76 FE 2C              cp ','              ; reached end of line?
0164   7D78 28 0B              jr z,dbox3          ; yes.
0165   7D7A FE 0D              cp 13               ; reached end of line?
0166   7D7C 28 07              jr z,dbox3          ; yes.
0167   7D7E 04                 inc b               ; add to this line's width.
0168   7D7F A7                 and a               ; end of message?
0169   7D80 FA 8C 7D           jp m,dbox4          ; yes, end count.
0170   7D83 18 EF              jr dbox6            ; repeat until we find the end.
0171   7D85 7B          dbox3  ld a,e              ; maximum line width.
0172   7D86 B8                 cp b                ; have we exceeded longest so far?
0173   7D87 30 E3              jr nc,dbox5         ; no, carry on looking.
0174   7D89 58                 ld e,b              ; make this the widest so far.
0175   7D8A 18 E0              jr dbox5            ; keep looking.
0176   7D8C 7B          dbox4  ld a,e              ; maximum line width.
0177   7D8D B8                 cp b                ; have we exceeded longest so far?
0178   7D8E 30 01              jr nc,dbox8         ; no, carry on looking.
0179   7D90 58                 ld e,b              ; final line is the longest so far.
0180   7D91 15          dbox8  dec d               ; decrement items found.
0181   7D92 CA 91 7E           jp z,dbox15         ; total was zero.
0182   7D95 7B                 ld a,e              ; longest line.
0183   7D96 A7                 and a               ; was it zero?
0184   7D97 CA 91 7E           jp z,dbox15         ; total was zero.
0185   7D9A ED 53 E8 7E        ld (bwid),de        ; set up size.
0186   7D9E             
0187   7D9E             ; That's set up our box size.
0188   7D9E             
0189   7D9E 3A 0D 7D           ld a,(winhgt)       ; window height in characters.
0190   7DA1 92                 sub d               ; subtract height of box.
0191   7DA2 1F                 rra                 ; divide by 2.
0192   7DA3 21 0B 7D           ld hl,wintop        ; top edge of window.
0193   7DA6 86                 add a,(hl)          ; add displacement.
0194   7DA7 32 EA 7E           ld (btop),a         ; set up box top.
0195   7DAA 3A 0E 7D           ld a,(winwid)       ; window width in characters.
0196   7DAD 93                 sub e               ; subtract box width.
0197   7DAE 1F                 rra                 ; divide by 2.
0198   7DAF 23                 inc hl              ; left edge of window.
0199   7DB0 86                 add a,(hl)          ; add displacement.
0200   7DB1 32 EB 7E           ld (blft),a         ; box left.
0201   7DB4 2A 36 5C           ld hl,(23606)       ; font.
0202   7DB7 22 5C 87           ld (grbase),hl      ; set up for text display.
0203   7DBA E1                 pop hl              ; restore message pointer.
0204   7DBB 3A EA 7E           ld a,(btop)         ; box top.
0205   7DBE 32 3A 7D           ld (dispx),a        ; set display coordinate.
0206   7DC1 AF                 xor a               ; start at object zero.
0207   7DC2 32 6F 89           ld (combyt),a       ; store number of object in combyt.
0208   7DC5 3A 6F 89    dbox2  ld a,(combyt)       ; get object number.
0209   7DC8 CD 25 8A    mod0   call always         ; check inventory for display.
0210   7DCB C2 7F 7E           jp nz,dbox13        ; not in inventory, skip this line.
0211   7DCE             
0212   7DCE 3A EB 7E           ld a,(blft)         ; box left.
0213   7DD1 32 3B 7D           ld (dispy),a        ; set left display position.
0214   7DD4 3A E8 7E           ld a,(bwid)         ; box width.
0215   7DD7 47                 ld b,a              ; store width.
0216   7DD8 7E          dbox0  ld a,(hl)           ; get character.
0217   7DD9 FE 2C              cp ','              ; end of line?
0218   7DDB 28 37              jr z,dbox1          ; yes, next one.
0219   7DDD FE 0D              cp 13               ; end of option?
0220   7DDF 28 33              jr z,dbox1          ; yes, on to next.
0221   7DE1 05                 dec b               ; one less to display.
0222   7DE2 E6 7F              and 127             ; remove terminator.
0223   7DE4 C5                 push bc             ; store characters remaining.
0224   7DE5 E5                 push hl             ; store address on stack.
0225   7DE6 F5                 push af             ; store character.
0226   7DE7             ;       call gaadd          ; get attribute address.
0227   7DE7             ;       ld a,(23693)        ; current colour.
0228   7DE7             ;       ld (hl),a           ; set attribute.
0229   7DE7 F1                 pop af              ; restore character.
0230   7DE8 CD 94 88           call pchr           ; display on screen.
0231   7DEB E1                 pop hl              ; retrieve address of next character.
0232   7DEC C1                 pop bc              ; chars left for this line.
0233   7DED 7E                 ld a,(hl)           ; get character.
0234   7DEE 23                 inc hl              ; next character.
0235   7DEF FE 80              cp 128              ; end of message?
0236   7DF1 D2 22 7E           jp nc,dbox7         ; yes, job done.
0237   7DF4 78                 ld a,b              ; chars remaining.
0238   7DF5 A7                 and a               ; are any left?
0239   7DF6 20 E0              jr nz,dbox0         ; yes, continue.
0240   7DF8             
0241   7DF8             ; Reached limit of characters per line.
0242   7DF8             
0243   7DF8 7E          dbox9  ld a,(hl)           ; get character.
0244   7DF9 23                 inc hl              ; next one.
0245   7DFA FE 2C              cp ','              ; another line?
0246   7DFC 28 1A              jr z,dbox10         ; yes, do next line.
0247   7DFE FE 0D              cp 13               ; another line?
0248   7E00 28 16              jr z,dbox10         ; yes, on to next.
0249   7E02 FE 80              cp 128              ; end of message?
0250   7E04 30 23              jr nc,dbox11        ; yes, finish message.
0251   7E06 18 F0              jr dbox9
0252   7E08             
0253   7E08             ; Fill box to end of line.
0254   7E08             
0255   7E08 E5          dboxf  push hl             ; store address on stack.
0256   7E09 C5                 push bc             ; store characters remaining.
0257   7E0A             ;       call gaadd          ; get attribute address.
0258   7E0A             ;       ld a,(23693)        ; current colour.
0259   7E0A             ;       ld (hl),a           ; set attribute.
0260   7E0A 3E 20              ld a,32             ; space character.
0261   7E0C CD 94 88           call pchr           ; display character.
0262   7E0F C1                 pop bc              ; retrieve character count.
0263   7E10 E1                 pop hl              ; retrieve address of next character.
0264   7E11 10 F5              djnz dboxf          ; repeat for remaining chars on line.
0265   7E13 C9                 ret
0266   7E14 23          dbox1  inc hl              ; skip character.
0267   7E15 CD 08 7E           call dboxf          ; fill box out to right side.
0268   7E18 3A 3A 7D    dbox10 ld a,(dispx)        ; x coordinate.
0269   7E1B 3C                 inc a               ; down a line.
0270   7E1C 32 3A 7D           ld (dispx),a        ; next position.
0271   7E1F C3 C5 7D           jp dbox2            ; next line.
0272   7E22 78          dbox7  ld a,b              ; chars remaining.
0273   7E23 A7                 and a               ; are any left?
0274   7E24 28 03              jr z,dbox11         ; no, nothing to draw.
0275   7E26 CD 08 7E           call dboxf          ; fill message to line.
0276   7E29             
0277   7E29             ; Drawn the box menu, now select option.
0278   7E29             
0279   7E29 3A EA 7E    dbox11 ld a,(btop)         ; box top.
0280   7E2C 32 3A 7D           ld (dispx),a        ; set bar position.
0281   7E2F CD 44 8B    dbox14 call joykey         ; get controls.
0282   7E32 E6 1F              and 31              ; anything pressed?
0283   7E34 20 F9              jr nz,dbox14        ; yes, debounce it.
0284   7E36 CD 93 7E           call dbar           ; draw bar.
0285   7E39 CD 44 8B    dbox12 call joykey         ; get controls.
0286   7E3C E6 1C              and 28              ; anything pressed?
0287   7E3E 28 F9              jr z,dbox12         ; no, nothing.
0288   7E40 E6 10              and 16              ; fire button pressed?
0289   7E42 C2 72 7E    mod1   jp nz,fstd          ; yes, job done.
0290   7E45 CD 93 7E           call dbar           ; delete bar.
0291   7E48 3A 09 7D           ld a,(joyval)       ; joystick reading.
0292   7E4B E6 08              and 8               ; going up?
0293   7E4D 20 13              jr nz,dboxu         ; yes, go up.
0294   7E4F 3A 3A 7D           ld a,(dispx)        ; vertical position of bar.
0295   7E52 3C                 inc a               ; look down.
0296   7E53 21 EA 7E           ld hl,btop          ; top of box.
0297   7E56 96                 sub (hl)            ; find distance from top.
0298   7E57 2B                 dec hl              ; point to height.
0299   7E58 BE                 cp (hl)             ; are we at end?
0300   7E59 CA 2F 7E           jp z,dbox14         ; yes, go no further.
0301   7E5C 21 3A 7D           ld hl,dispx         ; coordinate.
0302   7E5F 34                 inc (hl)            ; move bar.
0303   7E60 18 CD              jr dbox14           ; continue.
0304   7E62 3A 3A 7D    dboxu  ld a,(dispx)        ; vertical position of bar.
0305   7E65 21 EA 7E           ld hl,btop          ; top of box.
0306   7E68 BE                 cp (hl)             ; are we at the top?
0307   7E69 CA 2F 7E           jp z,dbox14         ; yes, go no further.
0308   7E6C 21 3A 7D           ld hl,dispx         ; coordinate.
0309   7E6F 35                 dec (hl)            ; move bar.
0310   7E70 18 BD              jr dbox14           ; continue.
0311   7E72 3A 3A 7D    fstd   ld a,(dispx)        ; bar position.
0312   7E75 21 EA 7E           ld hl,btop          ; top of menu.
0313   7E78 96                 sub (hl)            ; find selected option.
0314   7E79 32 34 7D           ld (varopt),a       ; store the option.
0315   7E7C C3 AE 7F           jp redraw           ; redraw the screen.
0316   7E7F             
0317   7E7F             ; Option not available.  Skip this line.
0318   7E7F             
0319   7E7F 7E          dbox13 ld a,(hl)           ; get character.
0320   7E80 23                 inc hl              ; next one.
0321   7E81 FE 2C              cp ','              ; another line?
0322   7E83 CA C5 7D           jp z,dbox2          ; yes, do next line.
0323   7E86 FE 0D              cp 13               ; another line?
0324   7E88 CA C5 7D           jp z,dbox2          ; yes, on to next line.
0325   7E8B A7                 and a               ; end of message?
0326   7E8C FA 29 7E           jp m,dbox11         ; yes, finish message.
0327   7E8F 18 EE              jr dbox13
0328   7E91 E1          dbox15 pop hl              ; pop message pointer from the stack.
0329   7E92 C9                 ret
0330   7E93             
0331   7E93 3A EB 7E    dbar   ld a,(blft)         ; box left.
0332   7E96 32 3B 7D           ld (dispy),a        ; set display coordinate.
0333   7E99 CD 01 88           call gprad          ; get printing address.
0334   7E9C EB                 ex de,hl            ; flip into hl register pair.
0335   7E9D 3A E8 7E           ld a,(bwid)         ; box width.
0336   7EA0 4F                 ld c,a              ; loop counter in c.
0337   7EA1 54                 ld d,h              ; store screen address high byte.
0338   7EA2 06 08       dbar1  ld b,8              ; pixel height in b.
0339   7EA4 7E          dbar0  ld a,(hl)           ; get screen byte.
0340   7EA5 2F                 cpl                 ; reverse all bits.
0341   7EA6 77                 ld (hl),a           ; write back to screen.
0342   7EA7 24                 inc h               ; next line down.
0343   7EA8 10 FA              djnz dbar0          ; draw rest of character.
0344   7EAA 62                 ld h,d              ; rsetore screen address.
0345   7EAB 2C                 inc l               ; one char right.
0346   7EAC 0D                 dec c               ; decrement character counter.
0347   7EAD 20 F3              jr nz,dbar1         ; repeat for whole line.
0348   7EAF C9                 ret
0349   7EB0             
0350   7EB0 E5          invdis push hl             ; store message text pointer.
0351   7EB1 D5                 push de             ; store de pair for line count.
0352   7EB2 21 6F 89           ld hl,combyt        ; object number.
0353   7EB5 7E                 ld a,(hl)           ; get object number.
0354   7EB6 34                 inc (hl)            ; ready for next one.
0355   7EB7 CD 7E 86           call gotob          ; check if we have object.
0356   7EBA D1                 pop de              ; retrieve de pair from stack.
0357   7EBB E1                 pop hl              ; retrieve text pointer.
0358   7EBC C9                 ret
0359   7EBD             ;always xor a               ; set zero flag.
0360   7EBD             ;       ret
0361   7EBD             
0362   7EBD             ; Find option selected.
0363   7EBD             
0364   7EBD 3A 3A 7D    fopt   ld a,(dispx)
0365   7EC0 21 EA 7E           ld hl,btop          ; top of menu.
0366   7EC3 96                 sub (hl)            ; find selected option.
0367   7EC4 3C                 inc a               ; object 0 needs one iteration, 1 needs 2 and so on.
0368   7EC5 47                 ld b,a              ; option selected in b register.
0369   7EC6 21 6F 89           ld hl,combyt        ; object number.
0370   7EC9 36 00              ld (hl),0           ; set to first item.
0371   7ECB C5          fopt0  push bc             ; store option counter in b register.
0372   7ECC CD DC 7E           call fobj           ; find next object in inventory.
0373   7ECF C1                 pop bc              ; restore option counter.
0374   7ED0 10 F9              djnz fopt0          ; repeat for relevant steps down the list.
0375   7ED2 3A 6F 89           ld a,(combyt)       ; get option.
0376   7ED5 3D                 dec a               ; one less, due to where we increment combyt.
0377   7ED6 32 34 7D           ld (varopt),a       ; store the option.
0378   7ED9 C3 AE 7F           jp redraw           ; redraw the screen.
0379   7EDC             
0380   7EDC 21 6F 89    fobj   ld hl,combyt        ; object number.
0381   7EDF 7E                 ld a,(hl)           ; get object number.
0382   7EE0 34                 inc (hl)            ; ready for next item.
0383   7EE1 C8                 ret z               ; in case we loop back to zero.
0384   7EE2 CD 7E 86           call gotob          ; do we have this item?
0385   7EE5 C8                 ret z               ; yes, it's on the list.
0386   7EE6 18 F4              jr fobj             ; repeat until we find next item in pockets.
0387   7EE8             
0388   7EE8 00          bwid   defb 0              ; box/menu width.
0389   7EE9 00          blen   defb 0              ; box/menu height.
0390   7EEA 00          btop   defb 0              ; box coordinates.
0391   7EEB 00          blft   defb 0
0392   7EEC             
0393   7EEC             ; Wait for keypress.
0394   7EEC             
0395   7EEC CD F8 7E    prskey call debkey         ; debounce key.
0396   7EEF CD 43 7F    prsky0 call vsync          ; vertical synch.
0397   7EF2 CD 8E 02           call 654            ; return keyboard state in e.
0398   7EF5 1C                 inc e               ; is it 255?
0399   7EF6 28 F7              jr z,prsky0         ; yes, repeat until key pressed.
0400   7EF8             
0401   7EF8             ; Debounce keypress.
0402   7EF8             
0403   7EF8 CD 43 7F    debkey call vsync          ; update scrolling, sounds etc.
0404   7EFB CD 8E 02           call 654            ; d=shift, e=key.
0405   7EFE 1C                 inc e               ; is it 255?
0406   7EFF 20 F7              jr nz,debkey        ; no - loop until key is released.
0407   7F01 C9                 ret
0408   7F02             
0409   7F02             ; Delay routine.
0410   7F02             
0411   7F02 C5          delay  push bc             ; store loop counter.
0412   7F03 CD 43 7F           call vsync          ; wait for interrupt.
0413   7F06 C1                 pop bc              ; restore counter.
0414   7F07 10 F9              djnz delay          ; repeat.
0415   7F09 C9                 ret
0416   7F0A             
0417   7F0A             ; Clear sprite table.
0418   7F0A             
0419   7F0A 21 6C 92    xspr   ld hl,sprtab        ; sprite table.
0420   7F0D 06 CC              ld b,SPRBUF         ; length of table.
0421   7F0F 36 FF       xspr0  ld (hl),255         ; clear one byte.
0422   7F11 23                 inc hl              ; move to next byte.
0423   7F12 10 FB              djnz xspr0          ; repeat for rest of table.
0424   7F14 C9                 ret
0425   7F15             
0426   7F15 CD 91 85    silenc call silen1         ; silence channel 1.
0427   7F18 CD 9E 85           call silen2         ; silence channel 2.
0428   7F1B CD AB 85           call silen3         ; silence channel 3.
0429   7F1E C3 9B CC           jp plsnd            ; play all channels to switch them off.
0430   7F21             
0431   7F21             ; Initialise all objects.
0432   7F21             
0433   7F21 DD 21 F3 C7 iniob  ld ix,objdta        ; objects table.
0434   7F25 3A 0F 7D           ld a,(numob)        ; number of objects in the game.
0435   7F28 47                 ld b,a              ; loop counter.
0436   7F29 11 26 00           ld de,38            ; distance between objects.
0437   7F2C DD 7E 23    iniob0 ld a,(ix+35)        ; start screen.
0438   7F2F DD 77 20           ld (ix+32),a        ; set start screen.
0439   7F32 DD 7E 24           ld a,(ix+36)        ; find start x.
0440   7F35 DD 77 21           ld (ix+33),a        ; set start x.
0441   7F38 DD 7E 25           ld a,(ix+37)        ; get initial y.
0442   7F3B DD 77 22           ld (ix+34),a        ; set y coord.
0443   7F3E DD 19              add ix,de           ; point to next object.
0444   7F40 10 EA              djnz iniob0         ; repeat.
0445   7F42 C9                 ret
0446   7F43             
0447   7F43             ; Screen synchronisation.
0448   7F43             
0449   7F43 CD 44 8B    vsync  call joykey         ; read joystick/keyboard.
0450   7F46 3A AD 7F           ld a,(sndtyp)       ; sound to play.
0451   7F49 A7                 and a               ; any sound?
0452   7F4A CA 74 7F           jp z,vsync1         ; no.
0453   7F4D 47                 ld b,a              ; outer loop.
0454   7F4E 3A 48 5C           ld a,(23624)        ; border colour.
0455   7F51 1F                 rra                 ; put border bits into d0, d1 and d2.
0456   7F52 1F                 rra
0457   7F53 1F                 rra
0458   7F54 4F                 ld c,a              ; first value to write to speaker.
0459   7F55 78                 ld a,b              ; sound.
0460   7F56 A7                 and a               ; test it.
0461   7F57 FA 8C 7F           jp m,vsync6         ; play white noise.
0462   7F5A 79          vsync2 ld a,c              ; get speaker value.
0463   7F5B D3 FE              out (254),a         ; write to speaker.
0464   7F5D EE F8              xor 248             ; toggle all except the border bits.
0465   7F5F 4F                 ld c,a              ; store value for next time.
0466   7F60 50                 ld d,b              ; store loop counter.
0467   7F61 21 31 7D    vsync3 ld hl,clock         ; previous clock setting.
0468   7F64 3A 78 5C           ld a,(23672)        ; current clock setting.
0469   7F67 BE                 cp (hl)             ; subtract last reading.
0470   7F68 C2 70 7F           jp nz,vsync4        ; yes, no more processing please.
0471   7F6B 10 F4              djnz vsync3         ; loop.
0472   7F6D 42                 ld b,d              ; restore loop counter.
0473   7F6E 10 EA              djnz vsync2         ; continue noise.
0474   7F70 7A          vsync4 ld a,d              ; where we got to.
0475   7F71 32 AD 7F    vsynca ld (sndtyp),a       ; remember for next time.
0476   7F74 3A 78 5C    vsync1 ld a,(23672)        ; clock low.
0477   7F77 1F                 rra                 ; rotate bit into carry.
0478   7F78 DC 86 7F           call c,vsync5       ; time to play sound and do shrapnel/ticker stuff.
0479   7F7B 21 31 7D           ld hl,clock         ; last clock reading.
0480   7F7E 3A 78 5C    vsync0 ld a,(23672)        ; current clock reading.
0481   7F81 BE                 cp (hl)             ; are they the same?
0482   7F82 28 FA              jr z,vsync0         ; yes, wait until clock changes.
0483   7F84 77                 ld (hl),a           ; set new clock reading.
0484   7F85 C9                 ret
0485   7F86 CD 9B CC    vsync5 call plsnd          ; play sound.
0486   7F89 C3 4B 80           jp proshr           ; shrapnel and stuff.
0487   7F8C             
0488   7F8C             ; Play white noise.
0489   7F8C             
0490   7F8C 78          vsync6 ld a,b              ; 128 - 255.
0491   7F8D D6 7F              sub 127
0492   7F8F 47                 ld b,a
0493   7F90 21 31 7D           ld hl,clock         ; previous clock setting.
0494   7F93 ED 5F       vsync7 ld a,r              ; get random speaker value.
0495   7F95 E6 F8              and 248             ; only retain the speaker/earphone bits.
0496   7F97 B1                 or c                ; merge with border colour.
0497   7F98 D3 FE              out (254),a         ; write to speaker.
0498   7F9A 3A 78 5C           ld a,(23672)        ; current clock setting.
0499   7F9D BE                 cp (hl)             ; subtract last reading.
0500   7F9E C2 AA 7F           jp nz,vsync8        ; yes, no more processing please.
0501   7FA1 78                 ld a,b
0502   7FA2 E6 7F              and 127
0503   7FA4 3C                 inc a
0504   7FA5 3D          vsync9 dec a
0505   7FA6 20 FD              jr nz,vsync9        ; loop.
0506   7FA8 10 E9              djnz vsync7         ; continue noise.
0507   7FAA AF          vsync8 xor a
0508   7FAB 18 C4              jr vsynca
0509   7FAD 00          sndtyp defb 0
0510   7FAE             ;clock  defb 0              ; last clock reading.
0511   7FAE             
0512   7FAE             ; Redraw the screen.
0513   7FAE             
0514   7FAE             ; Remove old copy of all sprites for redraw.
0515   7FAE             
0516   7FAE DD E5       redraw push ix             ; place sprite pointer on stack.
0517   7FB0 CD 22 89           call droom          ; show screen layout.
0518   7FB3 CD F2 85           call shwob          ; draw objects.
0519   7FB6 06 0C       numsp0 ld b,NUMSPR         ; sprites to draw.
0520   7FB8 DD 21 6C 92        ld ix,sprtab        ; sprite table.
0521   7FBC DD 7E 00    redrw0 ld a,(ix+0)         ; old sprite type.
0522   7FBF 3C                 inc a               ; is it enabled?
0523   7FC0 28 0C              jr z,redrw1         ; no, find next one.
0524   7FC2 DD 7E 03           ld a,(ix+3)         ; sprite x.
0525   7FC5 FE B1              cp 177              ; beyond maximum?
0526   7FC7 30 05              jr nc,redrw1        ; yes, nothing to draw.
0527   7FC9 C5                 push bc             ; store sprite counter.
0528   7FCA CD FD 8D           call sspria         ; show single sprite.
0529   7FCD C1                 pop bc              ; retrieve sprite counter.
0530   7FCE 11 11 00    redrw1 ld de,TABSIZ        ; distance to next odd/even entry.
0531   7FD1 DD 19              add ix,de           ; next sprite.
0532   7FD3 10 E7              djnz redrw0         ; repeat for remaining sprites.
0533   7FD5 CD ED 82    rpblc1 call dshrp          ; redraw shrapnel.
0534   7FD8 DD E1              pop ix              ; retrieve sprite pointer.
0535   7FDA C9                 ret
0536   7FDB             
0537   7FDB             ; Clear screen routine.
0538   7FDB             
0539   7FDB 21 00 00    cls    ld hl,0             ; set hl to origin (0, 0).
0540   7FDE 22 2F 7D           ld (charx),hl       ; reset coordinates.
0541   7FE1 21 00 40           ld hl,16384         ; screen address.
0542   7FE4 75                 ld (hl),l           ; blank first byte.
0543   7FE5 CD EF 7F           call cls0           ; clear remaining 6143 bytes.
0544   7FE8 21 00 60           ld hl,24576         ; attribute address.
0545   7FEB 3A 8D 5C           ld a,(23693)        ; fetch attributes.
0546   7FEE 77                 ld (hl),a           ; set first attribute cell.
0547   7FEF 54          cls0   ld d,h              ; copy to de,
0548   7FF0 1E 01              ld e,1              ; de = hl + 1.
0549   7FF2 01 FF 17           ld bc,6143          ; bytes to copy.
0550   7FF5 ED B0              ldir                ; blank them all.
0551   7FF7 C9                 ret
0552   7FF8             
0553   7FF8             ; Set palette routine not required for Timex Sinclair.
0554   7FF8             
0555   7FF8 C9          setpal ret
0556   7FF9             
0557   7FF9 7E          fdchk  ld a,(hl)           ; fetch cell.
0558   7FFA FE 04              cp FODDER           ; is it fodder?
0559   7FFC C0                 ret nz              ; no.
0560   7FFD 36 00              ld (hl),0           ; rewrite block type.
0561   7FFF E5                 push hl             ; store pointer to block.
0562   8000 11 00 58           ld de,MAP           ; address of map.
0563   8003 A7                 and a               ; clear carry flag for subtraction.
0564   8004 ED 52              sbc hl,de           ; find simple displacement for block.
0565   8006 7D                 ld a,l              ; low byte is y coordinate.
0566   8007 E6 1F              and 31              ; column position 0 - 31.
0567   8009 32 3B 7D           ld (dispy),a        ; set up y position.
0568   800C 29                 add hl,hl           ; multiply displacement by 8.
0569   800D 29                 add hl,hl
0570   800E 29                 add hl,hl
0571   800F 7C                 ld a,h              ; x coordinate now in h.
0572   8010 32 3A 7D           ld (dispx),a        ; set the display coordinate.
0573   8013 AF                 xor a               ; block to write.
0574   8014 CD 55 88           call pattr          ; write block.
0575   8017 E1                 pop hl              ; restore block pointer.
0576   8018 C9                 ret
0577   8019             
0578   8019             ; Colour a sprite.
0579   8019             
0580   8019 DD 6E 08    cspr   ld l,(ix+8)         ; x coordinate.
0581   801C DD 66 09           ld h,(ix+9)         ; y coordinate.
0582   801F 1E 03              ld e,3              ; default width.
0583   8021 7C                 ld a,h              ; horizontal position.
0584   8022 E6 07              and 7               ; is it straddling cells?
0585   8024 20 01              jr nz,cspr0         ; yes, width is okay.
0586   8026 1D                 dec e               ; decrement width as we're aligned on char boundary.
0587   8027 22 3A 7D    cspr0  ld (dispx),hl       ; set up coords for calculation.
0588   802A CD E0 8D           call scadd          ; find screen address.
0589   802D CB EC              set 5,h             ; switch to attribute screen.
0590   802F 06 10              ld b,16             ; height of sprite.
0591   8031 53          cspr2  ld d,e              ; copy width to d.
0592   8032 E5                 push hl             ; store attribute address.
0593   8033 7E          cspr1  ld a,(hl)           ; fetch screen contents.
0594   8034 E6 F8              and SIMASK          ; remove ink.
0595   8036 B1                 or c                ; put in the new ink.
0596   8037 77                 ld (hl),a           ; write back to screen.
0597   8038 2C                 inc l               ; adjacent byte.
0598   8039 15                 dec d               ; one less byte to write.
0599   803A 20 F7              jr nz,cspr1         ; repeat for all columns.
0600   803C E1                 pop hl              ; restore attribute address.
0601   803D CD BE 8E           call nattr          ; get address of next attribute cell down.
0602   8040 10 EF              djnz cspr2          ; repeat for all rows.
0603   8042 C9                 ret
0604   8043             
0605   8043             ; Scrolly text and puzzle variables.
0606   8043             
0607   8043 80          txtbit defb 128            ; bit to write.
0608   8044 10          txtwid defb 16             ; width of ticker message.
0609   8045 4C 94       txtpos defw msgdat
0610   8047 4C 94       txtini defw msgdat
0611   8049 16 40       txtscr defw 16406
0612   804B             
0613   804B             ; Specialist routines.
0614   804B             ; Process shrapnel.
0615   804B             
0616   804B DD 21 B6 F9 proshr ld ix,SHRAPN        ; table.
0617   804F 06 37              ld b,NUMSHR         ; shrapnel pieces to process.
0618   8051 11 06 00           ld de,SHRSIZ        ; distance to next.
0619   8054 DD 7E 00    prosh0 ld a,(ix+0)         ; on/off marker.
0620   8057 17                 rla                 ; check its status.
0621   8058 D4 62 80    proshx call nc,prosh1      ; on, so process it.
0622   805B DD 19              add ix,de           ; point there.
0623   805D 10 F5              djnz prosh0         ; round again.
0624   805F C3 E1 91           jp scrly
0625   8062 C5          prosh1 push bc             ; store counter.
0626   8063 CD EC 80           call plot           ; delete the pixel.
0627   8066 DD 7E 00           ld a,(ix+0)         ; restore shrapnel type.
0628   8069 21 7F 80           ld hl,shrptr        ; shrapnel routine pointers.
0629   806C CD 77 80           call prosh2         ; run the routine.
0630   806F CD CA 80           call chkxy          ; check x and y are good before we redisplay.
0631   8072 C1                 pop bc              ; restore counter.
0632   8073 11 06 00           ld de,SHRSIZ        ; distance to next.
0633   8076 C9                 ret
0634   8077 07          prosh2 rlca                ; 2 bytes per address.
0635   8078 5F                 ld e,a              ; copy to de.
0636   8079 19                 add hl,de           ; point to address of routine.
0637   807A 7E                 ld a,(hl)           ; get address low.
0638   807B 23                 inc hl              ; point to second byte.
0639   807C 66                 ld h,(hl)           ; fetch high byte from table.
0640   807D 6F                 ld l,a              ; put low byte in l.
0641   807E E9                 jp (hl)             ; jump to routine.
0642   807F             
0643   807F 80 81       shrptr defw laser          ; laser.
0644   8081 59 81              defw trail          ; vapour trail.
0645   8083 8F 80              defw shrap          ; shrapnel from explosion.
0646   8085 BA 80              defw dotl           ; horizontal starfield left.
0647   8087 BE 80              defw dotr           ; horizontal starfield right.
0648   8089 C2 80              defw dotu           ; vertical starfield up.
0649   808B C6 80              defw dotd           ; vertical starfield down.
0650   808D 4B 94              defw ptcusr         ; user particle.
0651   808F             
0652   808F             ; Explosion shrapnel.
0653   808F             
0654   808F DD 5E 01    shrap  ld e,(ix+1)         ; get the angle.
0655   8092 16 00              ld d,0              ; no high byte.
0656   8094 21 19 81           ld hl,shrsin        ; shrapnel sine table.
0657   8097 19                 add hl,de           ; point to sine.
0658   8098             
0659   8098 5E                 ld e,(hl)           ; fetch value from table.
0660   8099 23                 inc hl              ; next byte of table.
0661   809A 56                 ld d,(hl)           ; fetch value from table.
0662   809B 23                 inc hl              ; next byte of table.
0663   809C 4E                 ld c,(hl)           ; fetch value from table.
0664   809D 23                 inc hl              ; next byte of table.
0665   809E 46                 ld b,(hl)           ; fetch value from table.
0666   809F DD 6E 02           ld l,(ix+2)         ; x coordinate in hl.
0667   80A2 DD 66 03           ld h,(ix+3)
0668   80A5 19                 add hl,de           ; add sine.
0669   80A6 DD 75 02           ld (ix+2),l         ; store new coordinate.
0670   80A9 DD 74 03           ld (ix+3),h
0671   80AC DD 6E 04           ld l,(ix+4)         ; y coordinate in hl.
0672   80AF DD 66 05           ld h,(ix+5)
0673   80B2 09                 add hl,bc           ; add cosine.
0674   80B3 DD 75 04           ld (ix+4),l         ; store new coordinate.
0675   80B6 DD 74 05           ld (ix+5),h
0676   80B9 C9                 ret
0677   80BA             
0678   80BA DD 35 05    dotl   dec (ix+5)          ; move left.
0679   80BD C9                 ret
0680   80BE DD 34 05    dotr   inc (ix+5)          ; move left.
0681   80C1 C9                 ret
0682   80C2 DD 35 03    dotu   dec (ix+3)          ; move up.
0683   80C5 C9                 ret
0684   80C6 DD 34 03    dotd   inc (ix+3)          ; move down.
0685   80C9 C9                 ret
0686   80CA             
0687   80CA             ; Check coordinates are good before redrawing at new position.
0688   80CA             
0689   80CA 21 10 7D    chkxy  ld hl,wntopx        ; window top.
0690   80CD DD 7E 03           ld a,(ix+3)         ; fetch shrapnel coordinate.
0691   80D0 BE                 cp (hl)             ; compare with top window limit.
0692   80D1 38 41              jr c,kilshr         ; out of window, kill shrapnel.
0693   80D3 23                 inc hl              ; left edge.
0694   80D4 DD 7E 05           ld a,(ix+5)         ; fetch shrapnel coordinate.
0695   80D7 BE                 cp (hl)             ; compare with left window limit.
0696   80D8 38 3A              jr c,kilshr         ; out of window, kill shrapnel.
0697   80DA             
0698   80DA 23                 inc hl              ; point to bottom.
0699   80DB 7E                 ld a,(hl)           ; fetch window limit.
0700   80DC C6 0F              add a,15            ; add height of sprite.
0701   80DE DD BE 03           cp (ix+3)           ; compare with shrapnel x coordinate.
0702   80E1 38 31              jr c,kilshr         ; off screen, kill shrapnel.
0703   80E3 23                 inc hl              ; point to right edge.
0704   80E4 7E                 ld a,(hl)           ; fetch shrapnel y coordinate.
0705   80E5 C6 0F              add a,15            ; add width of sprite.
0706   80E7 DD BE 05           cp (ix+5)           ; compare with window limit.
0707   80EA 38 28              jr c,kilshr         ; off screen, kill shrapnel.
0708   80EC             
0709   80EC             ; Drop through.
0710   80EC             ; Display shrapnel.
0711   80EC             
0712   80EC DD 6E 03    plot   ld l,(ix+3)         ; x integer.
0713   80EF DD 66 05           ld h,(ix+5)         ; y integer.
0714   80F2 22 3A 7D           ld (dispx),hl       ; workspace coordinates.
0715   80F5 DD 7E 00           ld a,(ix+0)         ; type.
0716   80F8 A7                 and a               ; is it a laser?
0717   80F9 28 12              jr z,plot1          ; yes, draw laser instead.
0718   80FB 7C          plot0  ld a,h              ; which pixel within byte do we
0719   80FC E6 07              and 7               ; want to set first?
0720   80FE 16 00              ld d,0              ; no high byte.
0721   8100 5F                 ld e,a              ; copy to de.
0722   8101 21 AB 81           ld hl,dots          ; table of small pixel positions.
0723   8104 19                 add hl,de           ; hl points to values we want to POKE to screen.
0724   8105 5E                 ld e,(hl)           ; get value.
0725   8106 CD E0 8D           call scadd          ; screen address.
0726   8109 7E                 ld a,(hl)           ; see what's already there.
0727   810A AB                 xor e               ; merge with pixels.
0728   810B 77                 ld (hl),a           ; put back on screen.
0729   810C C9                 ret
0730   810D CD E0 8D    plot1  call scadd          ; screen address.
0731   8110 7E                 ld a,(hl)           ; fetch byte there.
0732   8111 2F                 cpl                 ; toggle all bits.
0733   8112 77                 ld (hl),a           ; new byte.
0734   8113 C9                 ret
0735   8114             
0736   8114 DD 36 00 80 kilshr ld (ix+0),128       ; switch off shrapnel.
0737   8118 C9                 ret
0738   8119             
0739   8119             shrsin defw 0,1024,391,946,724,724,946,391
0739   8119 000000048701B203D402D402B2038701
0740   8129                    defw 1024,0,946,65144,724,64811,391,64589
0740   8129 00040000B20378FED4022BFD87014DFC
0741   8139                    defw 0,64512,65144,64589,64811,64811,64589,65144
0741   8139 000000FC78FE4DFC2BFD2BFD4DFC78FE
0742   8149                    defw 64512,0,64589,391,64811,724,65144,946
0742   8149 00FC00004DFC87012BFDD40278FEB203
0743   8159             
0744   8159 DD 35 01    trail  dec (ix+1)          ; time remaining.
0745   815C CA 7B 81           jp z,trailk         ; time to switch it off.
0746   815F CD DF 82           call qrand          ; get a random number.
0747   8162 1F                 rra                 ; x or y axis?
0748   8163 38 0B              jr c,trailv         ; use x.
0749   8165 1F                 rra                 ; which direction?
0750   8166 38 04              jr c,traill         ; go left.
0751   8168 DD 34 05           inc (ix+5)          ; go right.
0752   816B C9                 ret
0753   816C DD 35 05    traill dec (ix+5)          ; go left.
0754   816F C9                 ret
0755   8170 1F          trailv rra                 ; which direction?
0756   8171 38 04              jr c,trailu         ; go up.
0757   8173 DD 34 03           inc (ix+3)          ; go down.
0758   8176 C9                 ret
0759   8177 DD 35 03    trailu dec (ix+3)          ; go up.
0760   817A C9                 ret
0761   817B DD 36 03 C8 trailk ld (ix+3),200       ; set off-screen to kill vapour trail.
0762   817F C9                 ret
0763   8180             
0764   8180 DD 7E 01    laser  ld a,(ix+1)         ; direction.
0765   8183 1F                 rra                 ; left or right?
0766   8184 30 04              jr nc,laserl        ; move left.
0767   8186 06 08              ld b,8              ; distance to travel.
0768   8188 18 02              jr laserm           ; move laser.
0769   818A 06 F8       laserl ld b,248            ; distance to travel.
0770   818C DD 7E 05    laserm ld a,(ix+5)         ; y position.
0771   818F 80                 add a,b             ; add distance.
0772   8190 DD 77 05           ld (ix+5),a         ; set new y coordinate.
0773   8193             
0774   8193             ; Test new block.
0775   8193             
0776   8193 32 3B 7D           ld (dispy),a        ; set y for block collision detection purposes.
0777   8196 DD 7E 03           ld a,(ix+3)         ; get x.
0778   8199 32 3A 7D           ld (dispx),a        ; set coordinate for collision test.
0779   819C CD DC 8A           call tstbl          ; get block type there.
0780   819F FE 02              cp WALL             ; is it solid?
0781   81A1 28 D8              jr z,trailk         ; yes, it cannot pass.
0782   81A3 FE 04              cp FODDER           ; is it fodder?
0783   81A5 C0                 ret nz              ; no, ignore it.
0784   81A6 CD F9 7F           call fdchk          ; remove fodder block.
0785   81A9 18 D0              jr trailk           ; destroy laser.
0786   81AB             
0787   81AB             dots   defb 128,64,32,16,8,4,2,1
0787   81AB 8040201008040201
0788   81B3             
0789   81B3             ; Plot, preserving de.
0790   81B3             
0791   81B3 D5          plotde push de             ; put de on stack.
0792   81B4 CD EC 80           call plot           ; plot pixel.
0793   81B7 D1                 pop de              ; restore de from stack.
0794   81B8 C9                 ret
0795   81B9             
0796   81B9             ; Shoot a laser.
0797   81B9             
0798   81B9 4F          shoot  ld c,a              ; store direction in c register.
0799   81BA DD 7E 08           ld a,(ix+8)         ; x coordinate.
0800   81BD C6 07       shoot1 add a,7             ; down 7 pixels.
0801   81BF 6F                 ld l,a              ; puty x coordinate in l.
0802   81C0 DD 66 09           ld h,(ix+9)         ; y coordinate in h.
0803   81C3 DD E5              push ix             ; store pointer to sprite.
0804   81C5 CD 87 82           call fpslot         ; find particle slot.
0805   81C8 30 2C              jr nc,vapou2        ; failed, restore ix.
0806   81CA DD 36 00 00        ld (ix+0),0         ; set up a laser.
0807   81CE DD 71 01           ld (ix+1),c         ; set the direction.
0808   81D1 DD 75 03           ld (ix+3),l         ; set x coordinate.
0809   81D4 CB 19              rr c                ; check direction we want.
0810   81D6 38 08              jr c,shootr         ; shoot right.
0811   81D8 7C                 ld a,h              ; y position.
0812   81D9             ;       dec a               ; left a pixel.
0813   81D9 E6 F8       shoot0 and 248             ; align on character boundary.
0814   81DB DD 77 05           ld (ix+5),a         ; set y coordinate.
0815   81DE 18 2D              jr vapou0           ; draw first image.
0816   81E0 7C          shootr ld a,h              ; y position.
0817   81E1 C6 0F              add a,15            ; look right.
0818   81E3 18 F4              jr shoot0           ; align and continue.
0819   81E5             
0820   81E5             ; Create a bit of vapour trail.
0821   81E5             
0822   81E5 DD E5       vapour push ix             ; store pointer to sprite.
0823   81E7 DD 6E 08           ld l,(ix+8)         ; x coordinate.
0824   81EA DD 66 09           ld h,(ix+9)         ; y coordinate.
0825   81ED 11 07 07    vapou3 ld de,7*256+7       ; mid-point of sprite.
0826   81F0 19                 add hl,de           ; point to centre of sprite.
0827   81F1 CD 87 82           call fpslot         ; find particle slot.
0828   81F4 38 03              jr c,vapou1         ; no, we can use it.
0829   81F6 DD E1       vapou2 pop ix              ; restore sprite pointer.
0830   81F8 C9                 ret                 ; out of slots, can't generate anything.
0831   81F9             
0832   81F9 DD 75 03    vapou1 ld (ix+3),l         ; set up x.
0833   81FC DD 74 05           ld (ix+5),h         ; set up y coordinate.
0834   81FF CD DF 82           call qrand          ; get quick random number.
0835   8202 E6 0F              and 15              ; random time.
0836   8204 C6 0F              add a,15            ; minimum time on screen.
0837   8206 DD 77 01           ld (ix+1),a         ; set time on screen.
0838   8209 DD 36 00 01        ld (ix+0),1         ; define particle as vapour trail.
0839   820D CD CA 80    vapou0 call chkxy          ; plot first position.
0840   8210 18 E4              jr vapou2
0841   8212             
0842   8212             ; Create a user particle.
0843   8212             
0844   8212 08          ptusr  ex af,af'           ; store timer.
0845   8213 DD 6E 08           ld l,(ix+8)         ; x coordinate.
0846   8216 DD 66 09           ld h,(ix+9)         ; y coordinate.
0847   8219 11 07 07           ld de,7*256+7       ; mid-point of sprite.
0848   821C 19                 add hl,de           ; point to centre of sprite.
0849   821D CD 87 82           call fpslot         ; find particle slot.
0850   8220 38 01              jr c,ptusr1         ; no, we can use it.
0851   8222 C9                 ret                 ; out of slots, can't generate anything.
0852   8223             
0853   8223 DD 75 03    ptusr1 ld (ix+3),l         ; set up x.
0854   8226 DD 74 05           ld (ix+5),h         ; set up y coordinate.
0855   8229 08                 ex af,af'           ; restore timer.
0856   822A DD 77 01           ld (ix+1),a         ; set time on screen.
0857   822D DD 36 00 07        ld (ix+0),7         ; define particle as user particle.
0858   8231 C3 CA 80           jp chkxy            ; plot first position.
0859   8234             
0860   8234             
0861   8234             ; Create a vertical or horizontal star.
0862   8234             
0863   8234 DD E5       star   push ix             ; store pointer to sprite.
0864   8236 CD 87 82           call fpslot         ; find particle slot.
0865   8239 DA 3F 82           jp c,star7          ; found one we can use.
0866   823C DD E1       star0  pop ix              ; restore sprite pointer.
0867   823E C9                 ret                 ; out of slots, can't generate anything.
0868   823F             
0869   823F 79          star7  ld a,c              ; direction.
0870   8240 E6 03              and 3               ; is it left?
0871   8242 28 21              jr z,star1          ; yes, it's horizontal.
0872   8244 3D                 dec a               ; is it right?
0873   8245 28 2C              jr z,star2          ; yes, it's horizontal.
0874   8247 3D                 dec a               ; is it up?
0875   8248 28 35              jr z,star3          ; yes, it's vertical.
0876   824A             
0877   824A 3A 10 7D           ld a,(wntopx)       ; get edge of screen.
0878   824D 3C                 inc a               ; down one pixel.
0879   824E DD 77 03    star8  ld (ix+3),a         ; set x coord.
0880   8251 CD DF 82           call qrand          ; get quick random number.
0881   8254 DD 77 05    star9  ld (ix+5),a         ; set y position.
0882   8257 79                 ld a,c              ; direction.
0883   8258 E6 03              and 3               ; zero to three.
0884   825A C6 03              add a,3             ; 3 to 6 for starfield.
0885   825C DD 77 00           ld (ix+0),a         ; define particle as star.
0886   825F CD CA 80           call chkxy          ; plot first position.
0887   8262 C3 3C 82           jp star0
0888   8265 CD DF 82    star1  call qrand          ; get quick random number.
0889   8268 DD 77 03           ld (ix+3),a         ; set x coord.
0890   826B 3A 13 7D           ld a,(wnrgtx)       ; get edge of screen.
0891   826E C6 0F              add a,15            ; add width of sprite minus 1.
0892   8270 C3 54 82           jp star9
0893   8273 CD DF 82    star2  call qrand          ; get quick random number.
0894   8276 DD 77 03           ld (ix+3),a         ; set x coord.
0895   8279 3A 11 7D           ld a,(wnlftx)       ; get edge of screen.
0896   827C C3 54 82           jp star9
0897   827F 3A 12 7D    star3  ld a,(wnbotx)       ; get edge of screen.
0898   8282 C6 0F              add a,15            ; height of sprite minus one pixel.
0899   8284 C3 4E 82           jp star8
0900   8287             
0901   8287             
0902   8287             ; Find particle slot for lasers or vapour trail.
0903   8287             ; Can't use alternate accumulator.
0904   8287             
0905   8287 DD 21 B6 F9 fpslot ld ix,SHRAPN        ; shrapnel table.
0906   828B 11 06 00           ld de,SHRSIZ        ; size of each particle.
0907   828E 06 37              ld b,NUMSHR         ; number of pieces in table.
0908   8290 DD 7E 00    fpslt0 ld a,(ix+0)         ; get type.
0909   8293 17                 rla                 ; is this slot in use?
0910   8294 D8                 ret c               ; no, we can use it.
0911   8295 DD 19              add ix,de           ; point to more shrapnel.
0912   8297 10 F7              djnz fpslt0         ; repeat for all shrapnel.
0913   8299 C9                 ret                 ; out of slots, can't generate anything.
0914   829A             
0915   829A             ; Create an explosion at sprite position.
0916   829A             
0917   829A 4F          explod ld c,a              ; particles to create.
0918   829B DD E5              push ix             ; store pointer to sprite.
0919   829D DD 6E 08           ld l,(ix+8)         ; x coordinate.
0920   82A0 DD 66 09           ld h,(ix+9)         ; y coordinate.
0921   82A3 DD 21 B6 F9        ld ix,SHRAPN        ; shrapnel table.
0922   82A7 11 06 00           ld de,SHRSIZ        ; size of each particle.
0923   82AA 06 37              ld b,NUMSHR         ; number of pieces in table.
0924   82AC DD 7E 00    expld0 ld a,(ix+0)         ; get type.
0925   82AF 17                 rla                 ; is this slot in use?
0926   82B0 38 07              jr c,expld1         ; no, we can use it.
0927   82B2 DD 19       expld2 add ix,de           ; point to more shrapnel.
0928   82B4 10 F6              djnz expld0         ; repeat for all shrapnel.
0929   82B6 DD E1       expld3 pop ix              ; restore sprite pointer.
0930   82B8 C9                 ret                 ; out of slots, can't generate any more.
0931   82B9 79          expld1 ld a,c              ; shrapnel counter.
0932   82BA E6 0F              and 15              ; 0 to 15.
0933   82BC 85                 add a,l             ; add to x.
0934   82BD DD 77 03           ld (ix+3),a         ; x coord.
0935   82C0 3A EC 82           ld a,(seed3)        ; crap random number.
0936   82C3 E6 0F              and 15              ; 0 to 15.
0937   82C5 84                 add a,h             ; add to y.
0938   82C6 DD 77 05           ld (ix+5),a         ; y coord.
0939   82C9 DD 36 00 02        ld (ix+0),2         ; switch it on.
0940   82CD D9                 exx                 ; store coordinates.
0941   82CE CD CA 80           call chkxy          ; plot first position.
0942   82D1 CD DF 82           call qrand          ; quick random angle.
0943   82D4 E6 3C              and 60              ; keep within range.
0944   82D6 DD 77 01           ld (ix+1),a         ; angle.
0945   82D9 D9                 exx                 ; restore coordinates.
0946   82DA 0D                 dec c               ; one less piece of shrapnel to generate.
0947   82DB 20 D5              jr nz,expld2        ; back to main explosion loop.
0948   82DD 18 D7              jr expld3           ; restore sprite pointer and exit.
0949   82DF 3A EC 82    qrand  ld a,(seed3)        ; random seed.
0950   82E2 6F                 ld l,a              ; low byte.
0951   82E3 26 00              ld h,0              ; no high byte.
0952   82E5 ED 5F              ld a,r              ; r register.
0953   82E7 AE                 xor (hl)            ; combine with seed.
0954   82E8 32 EC 82           ld (seed3),a        ; new seed.
0955   82EB C9                 ret
0956   82EC 00          seed3  defb 0
0957   82ED             
0958   82ED             ; Display all shrapnel.
0959   82ED             
0960   82ED 21 B3 81    dshrp  ld hl,plotde        ; display routine.
0961   82F0 22 59 80           ld (proshx+1),hl    ; modify routine.
0962   82F3 CD 4B 80           call proshr         ; process shrapnel.
0963   82F6 21 62 80           ld hl,prosh1        ; processing routine.
0964   82F9 22 59 80           ld (proshx+1),hl    ; modify the call.
0965   82FC C9                 ret
0966   82FD             
0967   82FD             ; Particle engine.
0968   82FD             
0969   82FD 21 B6 F9    inishr ld hl,SHRAPN        ; table.
0970   8300 06 37              ld b,NUMSHR         ; shrapnel pieces to process.
0971   8302 11 06 00           ld de,SHRSIZ        ; distance to next.
0972   8305 36 FF       inish0 ld (hl),255         ; kill the shrapnel.
0973   8307 19                 add hl,de           ; point there.
0974   8308 10 FB              djnz inish0         ; round again.
0975   830A C9                 ret
0976   830B             
0977   830B             ; Check for collision between laser and sprite.
0978   830B             
0979   830B 21 B6 F9    lcol   ld hl,SHRAPN        ; shrapnel table.
0980   830E 11 06 00           ld de,SHRSIZ        ; size of each particle.
0981   8311 06 37              ld b,NUMSHR         ; number of pieces in table.
0982   8313 7E          lcol0  ld a,(hl)           ; get type.
0983   8314 A7                 and a               ; is this slot a laser?
0984   8315 28 04              jr z,lcol1          ; yes, check collision.
0985   8317 19          lcol3  add hl,de           ; point to more shrapnel.
0986   8318 10 F9              djnz lcol0          ; repeat for all shrapnel.
0987   831A C9                 ret                 ; no collision, carry not set.
0988   831B E5          lcol1  push hl             ; store pointer to laser.
0989   831C 23                 inc hl              ; direction.
0990   831D 23                 inc hl              ; not used.
0991   831E 23                 inc hl              ; x position.
0992   831F 7E                 ld a,(hl)           ; get x.
0993   8320 DD 96 08           sub (ix+X)          ; subtract sprite x.
0994   8323 FE 10       lcolh  cp 16               ; within range?
0995   8325 30 0A              jr nc,lcol2         ; no, missed.
0996   8327 23                 inc hl              ; not used.
0997   8328 23                 inc hl              ; y position.
0998   8329 7E                 ld a,(hl)           ; get y.
0999   832A DD 96 09           sub (ix+Y)          ; subtract sprite y.
1000   832D FE 10              cp 16               ; within range?
1001   832F 38 03              jr c,lcol4          ; yes, collision occurred.
1002   8331 E1          lcol2  pop hl              ; restore laser pointer from stack.
1003   8332 18 E3              jr lcol3
1004   8334 E1          lcol4  pop hl              ; restore laser pointer.
1005   8335 C9                 ret                 ; return with carry set for collision.
1006   8336             
1007   8336             ; Main game engine code starts here.
1008   8336             
1009   8336             game   equ $
1010   8336             
1011   8336             ; Set up screen address table.
1012   8336             
1013   8336 21 00 40    setsat ld hl,16384         ; start of screen.
1014   8339 11 00 FB           ld de,SCADTB        ; screen address table.
1015   833C 06 00              ld b,0              ; vertical lines on screen.
1016   833E EB          setsa0 ex de,hl            ; flip table and screen address.
1017   833F 72                 ld (hl),d           ; write high byte.
1018   8340 24                 inc h               ; second table.
1019   8341 73                 ld (hl),e           ; write low byte.
1020   8342 25                 dec h               ; back to first table.
1021   8343 2C                 inc l               ; next position in table.
1022   8344 EB                 ex de,hl            ; flip table and screen address back again.
1023   8345 CD A6 8E           call nline          ; next line down.
1024   8348 10 F4              djnz setsa0         ; repeat for all lines.
1025   834A             
1026   834A 01 FF 00           ld bc,255           ; screen select port.
1027   834D 3E 02              ld a,2              ; high-colour mode.
1028   834F ED 79              out (c),a           ; select screen mode.
1029   8351 CD F8 7F           call setpal         ; set up ULAplus palette.
1030   8354 CD FD 82    rpblc2 call inishr         ; initialise particle engine.
1031   8357 CD 42 94    evintr call evnt12         ; call intro/menu event.
1032   835A             
1033   835A 21 00 58           ld hl,MAP           ; block properties.
1034   835D 11 01 58           ld de,MAP+1         ; next byte.
1035   8360 01 FF 02           ld bc,767           ; size of property map.
1036   8363 36 02              ld (hl),WALL        ; write default property.
1037   8365 ED B0              ldir
1038   8367 CD 21 7F           call iniob          ; initialise objects.
1039   836A AF                 xor a               ; put zero in accumulator.
1040   836B 32 39 7D           ld (gamwon),a       ; reset game won flag.
1041   836E             
1042   836E 21 4A 87           ld hl,score         ; score.
1043   8371 CD A3 84           call inisc          ; init the score.
1044   8374 3A 35 94    mapst  ld a,(stmap)        ; start position on map.
1045   8377 32 49 93           ld (roomtb),a       ; set up position in table, if there is one.
1046   837A CD 75 8F    inipbl call initsc         ; set up first screen.
1047   837D DD 21 38 93        ld ix,ssprit        ; default to spare sprite in table.
1048   8381 CD 43 94    evini  call evnt13         ; initialisation.
1049   8384             
1050   8384             ; Two restarts.
1051   8384             ; First restart - clear all sprites and initialise everything.
1052   8384             
1053   8384 CD 5E 84    rstrt  call rsevt          ; restart events.
1054   8387 CD 0A 7F           call xspr           ; clear sprite table.
1055   838A CD C7 90           call sprlst         ; fetch pointer to screen sprites.
1056   838D CD 10 91           call ispr           ; initialise sprite table.
1057   8390 18 0C              jr rstrt0
1058   8392             
1059   8392             ; Second restart - clear all but player, and don't initialise him.
1060   8392             
1061   8392 CD 5E 84    rstrtn call rsevt          ; restart events.
1062   8395 CD DE 90           call nspr           ; clear all non-player sprites.
1063   8398 CD C7 90           call sprlst         ; fetch pointer to screen sprites.
1064   839B CD 36 91           call kspr           ; initialise sprite table, no more players.
1065   839E             
1066   839E             
1067   839E             ; Set up the player and/or enemy sprites.
1068   839E             
1069   839E AF          rstrt0 xor a               ; zero in accumulator.
1070   839F 32 36 7D           ld (nexlev),a       ; reset next level flag.
1071   83A2 32 37 7D           ld (restfl),a       ; reset restart flag.
1072   83A5 32 38 7D           ld (deadf),a        ; reset dead flag.
1073   83A8 CD 22 89           call droom          ; show screen layout.
1074   83AB CD FD 82    rpblc0 call inishr         ; initialise particle engine.
1075   83AE CD F2 85           call shwob          ; draw objects.
1076   83B1 DD 21 6C 92        ld ix,sprtab        ; address of sprite table, even sprites.
1077   83B5 CD 30 8D           call dspr           ; display sprites.
1078   83B8 DD 21 7D 92        ld ix,sprtab+TABSIZ ; address of first odd sprite.
1079   83BC CD 30 8D           call dspr           ; display sprites.
1080   83BF             
1081   83BF CD 43 7F    mloop  call vsync          ; synchronise with display.
1082   83C2             
1083   83C2 DD 21 6C 92        ld ix,sprtab        ; address of sprite table, even sprites.
1084   83C6 CD 30 8D           call dspr           ; display even sprites.
1085   83C9             
1086   83C9 CD 9B CC           call plsnd          ; play sounds.
1087   83CC CD 43 7F           call vsync          ; synchronise with display.
1088   83CF DD 21 7D 92        ld ix,sprtab+TABSIZ ; address of first odd sprite.
1089   83D3 CD 30 8D           call dspr           ; display odd sprites.
1090   83D6 DD 21 38 93        ld ix,ssprit        ; point to spare sprite for spawning purposes.
1091   83DA CD 40 94    evlp1  call evnt10         ; called once per main loop.
1092   83DD CD EB 8C           call pspr           ; process sprites.
1093   83E0             
1094   83E0             ; Main loop events.
1095   83E0             
1096   83E0 DD 21 38 93        ld ix,ssprit        ; point to spare sprite for spawning purposes.
1097   83E4 CD 41 94    evlp2  call evnt11         ; called once per main loop.
1098   83E7             
1099   83E7 CD 9C 8C    bsortx call bsort          ; sort sprites.
1100   83EA 3A 36 7D           ld a,(nexlev)       ; finished level flag.
1101   83ED A7                 and a               ; has it been set?
1102   83EE 20 1D              jr nz,newlev        ; yes, go to next level.
1103   83F0 3A 39 7D           ld a,(gamwon)       ; finished game flag.
1104   83F3 A7                 and a               ; has it been set?
1105   83F4 20 27              jr nz,evwon         ; yes, finish the game.
1106   83F6 3A 37 7D           ld a,(restfl)       ; finished level flag.
1107   83F9 3D                 dec a               ; has it been set?
1108   83FA 28 88              jr z,rstrt          ; yes, go to next level.
1109   83FC 3D                 dec a               ; has it been set?
1110   83FD 28 93              jr z,rstrtn         ; yes, go to next level.
1111   83FF             
1112   83FF 3A 38 7D           ld a,(deadf)        ; dead flag.
1113   8402 A7                 and a               ; is it non-zero?
1114   8403 20 1E              jr nz,pdead         ; yes, player dead.
1115   8405             
1116   8405 21 0A 7D           ld hl,frmno         ; game frame.
1117   8408 34                 inc (hl)            ; advance the frame.
1118   8409             
1119   8409             ; Back to start of main loop.
1120   8409             
1121   8409 C3 BF 83    qoff   jp mloop            ; switched to a jp nz,mloop during test mode.
1122   840C C9                 ret
1123   840D 3A 14 7D    newlev ld a,(scno)         ; current screen.
1124   8410 21 D7 C6           ld hl,numsc         ; total number of screens.
1125   8413 3C                 inc a               ; next screen.
1126   8414 BE                 cp (hl)             ; reached the limit?
1127   8415 30 06              jr nc,evwon         ; yes, game finished.
1128   8417 32 14 7D           ld (scno),a         ; set new level number.
1129   841A C3 84 83           jp rstrt            ; restart, clearing all aliens.
1130   841D CD 48 94    evwon  call evnt18         ; game completed.
1131   8420 C3 34 84           jp tidyup           ; tidy up and return to BASIC/calling routine.
1132   8423             
1133   8423             ; Player dead.
1134   8423             
1135   8423 AF          pdead  xor a               ; zeroise accumulator.
1136   8424 32 38 7D           ld (deadf),a        ; reset dead flag.
1137   8427 CD 46 94    evdie  call evnt16         ; death subroutine.
1138   842A 3A 15 7D           ld a,(numlif)       ; number of lives.
1139   842D A7                 and a               ; reached zero yet?
1140   842E C2 84 83           jp nz,rstrt         ; restart game.
1141   8431 CD 47 94    evfail call evnt17         ; failure event.
1142   8434 21 50 87    tidyup ld hl,hiscor        ; high score.
1143   8437 11 4A 87           ld de,score         ; player's score.
1144   843A 06 06              ld b,6              ; digits to check.
1145   843C 1A          tidyu2 ld a,(de)           ; get score digit.
1146   843D BE                 cp (hl)             ; are we larger than high score digit?
1147   843E 38 06              jr c,tidyu0         ; high score is bigger.
1148   8440 20 0C              jr nz,tidyu1        ; score is greater, record new high score.
1149   8442 23                 inc hl              ; next digit of high score.
1150   8443 13                 inc de              ; next digit of score.
1151   8444 10 F6              djnz tidyu2         ; repeat for all digits.
1152   8446 21 58 27    tidyu0 ld hl,10072         ; BASIC likes this in alternate hl.
1153   8449 D9                 exx                 ; flip hl into alternate registers.
1154   844A 01 4A 87           ld bc,score         ; return pointing to score.
1155   844D C9                 ret
1156   844E 21 4A 87    tidyu1 ld hl,score         ; score.
1157   8451 11 50 87           ld de,hiscor        ; high score.
1158   8454 01 06 00           ld bc,6             ; digits to copy.
1159   8457 ED B0              ldir                ; copy score to high score.
1160   8459 CD 49 94    evnewh call evnt19         ; new high score event.
1161   845C 18 E8              jr tidyu0           ; tidy up.
1162   845E             
1163   845E             ; Restart event.
1164   845E             
1165   845E DD 21 38 93 rsevt  ld ix,ssprit        ; default to spare element in table.
1166   8462 C3 44 94    evrs   jp evnt14           ; call restart event.
1167   8465             
1168   8465             ; Copy number passed in a to string position bc, right-justified.
1169   8465             
1170   8465 6F          num2ch ld l,a              ; put accumulator in l.
1171   8466 26 00              ld h,0              ; blank high byte of hl.
1172   8468 3E 20              ld a,32             ; leading spaces.
1173   846A 11 64 00    numdg3 ld de,100           ; hundreds column.
1174   846D CD 7B 84           call numdg          ; show digit.
1175   8470 11 0A 00    numdg2 ld de,10            ; tens column.
1176   8473 CD 7B 84           call numdg          ; show digit.
1177   8476 F6 10              or 16               ; last digit is always shown.
1178   8478 11 01 00           ld de,1             ; units column.
1179   847B E6 30       numdg  and 48              ; clear carry, clear digit.
1180   847D ED 52       numdg1 sbc hl,de           ; subtract from column.
1181   847F 38 05              jr c,numdg0         ; nothing to show.
1182   8481 F6 10              or 16               ; something to show, make it a digit.
1183   8483 3C                 inc a               ; increment digit.
1184   8484 18 F7              jr numdg1           ; repeat until column is zero.
1185   8486 19          numdg0 add hl,de           ; restore total.
1186   8487 FE 20              cp 32               ; leading space?
1187   8489 C8                 ret z               ; yes, don't write that.
1188   848A 02                 ld (bc),a           ; write digit to buffer.
1189   848B 03                 inc bc              ; next buffer position.
1190   848C C9                 ret
1191   848D 6F          num2dd ld l,a              ; put accumulator in l.
1192   848E 26 00              ld h,0              ; blank high byte of hl.
1193   8490 3E 20              ld a,32             ; leading spaces.
1194   8492 11 64 00           ld de,100           ; hundreds column.
1195   8495 CD 7B 84           call numdg          ; show digit.
1196   8498 F6 10              or 16               ; second digit is always shown.
1197   849A 18 D4              jr numdg2
1198   849C 6F          num2td ld l,a              ; put accumulator in l.
1199   849D 26 00              ld h,0              ; blank high byte of hl.
1200   849F 3E 30              ld a,48             ; leading spaces.
1201   84A1 18 C7              jr numdg3
1202   84A3             
1203   84A3 06 06       inisc  ld b,6              ; digits to initialise.
1204   84A5 36 30       inisc0 ld (hl),'0'         ; write zero digit.
1205   84A7 23                 inc hl              ; next column.
1206   84A8 10 FB              djnz inisc0         ; repeat for all digits.
1207   84AA C9                 ret
1208   84AB             
1209   84AB             
1210   84AB             ; Multiply h by d and return in hl.
1211   84AB             
1212   84AB 5A          imul   ld e,d              ; HL = H * D
1213   84AC 4C                 ld c,h              ; make c first multiplier.
1214   84AD 21 00 00    imul0  ld hl,0             ; zeroise total.
1215   84B0 54                 ld d,h              ; zeroise high byte.
1216   84B1 06 08              ld b,8              ; repeat 8 times.
1217   84B3 CB 19       imul1  rr c                ; rotate rightmost bit into carry.
1218   84B5 30 02              jr nc,imul2         ; wasn't set.
1219   84B7 19                 add hl,de           ; bit was set, so add de.
1220   84B8 A7                 and a               ; reset carry.
1221   84B9 CB 13       imul2  rl e                ; shift de 1 bit left.
1222   84BB CB 12              rl d
1223   84BD 10 F4              djnz imul1          ; repeat 8 times.
1224   84BF C9                 ret
1225   84C0             
1226   84C0             ; Divide d by e and return in d, remainder in a.
1227   84C0             
1228   84C0 AF          idiv   xor a
1229   84C1 06 08              ld b,8              ; bits to shift.
1230   84C3 CB 22       idiv0  sla d               ; multiply d by 2.
1231   84C5 17                 rla                 ; shift carry into remainder.
1232   84C6 BB                 cp e                ; test if e is smaller.
1233   84C7 38 02              jr c,idiv1          ; e is greater, no division this time.
1234   84C9 93                 sub e               ; subtract it.
1235   84CA 14                 inc d               ; rotate into d.
1236   84CB 10 F6       idiv1  djnz idiv0
1237   84CD C9                 ret
1238   84CE             
1239   84CE             ; Initialise a sound.
1240   84CE             
1241   84CE ED 5B F3 84 isnd   ld de,(ch1ptr)      ; first pointer.
1242   84D2 1A                 ld a,(de)           ; get first byte.
1243   84D3 3C                 inc a               ; reached the end?
1244   84D4 28 11              jr z,isnd1          ; that'll do.
1245   84D6 ED 5B F5 84        ld de,(ch2ptr)      ; second pointer.
1246   84DA 1A                 ld a,(de)           ; get first byte.
1247   84DB 3C                 inc a               ; reached the end?
1248   84DC 28 0D              jr z,isnd2          ; that'll do.
1249   84DE ED 5B F7 84        ld de,(ch3ptr)      ; final pointer.
1250   84E2 1A                 ld a,(de)           ; get first byte.
1251   84E3 3C                 inc a               ; reached the end?
1252   84E4 28 09              jr z,isnd3          ; that'll do.
1253   84E6 C9                 ret
1254   84E7 22 F3 84    isnd1  ld (ch1ptr),hl      ; set up the sound.
1255   84EA C9                 ret
1256   84EB 22 F5 84    isnd2  ld (ch2ptr),hl      ; set up the sound.
1257   84EE C9                 ret
1258   84EF 22 F7 84    isnd3  ld (ch3ptr),hl      ; set up the sound.
1259   84F2 C9                 ret
1260   84F3             
1261   84F3             
1262   84F3 F5 8D       ch1ptr defw spmask
1263   84F5 F5 8D       ch2ptr defw spmask
1264   84F7 F5 8D       ch3ptr defw spmask
1265   84F9             
1266   84F9             ; Write the contents of our AY buffer to the AY registers.
1267   84F9             
1268   84F9 21 10 85    w8912  ld hl,snddat        ; start of AY-3-8912 register data.
1269   84FC 11 00 0E           ld de,14*256        ; start with register 0, 14 to write.
1270   84FF 06 FF              ld b,255            ; high byte of port to write.
1271   8501 0E F5       w8912a ld c,245            ; port 65525=select soundchip register.
1272   8503 ED 59              out (c),e           ; tell chip which register we're writing.
1273   8505 7E                 ld a,(hl)           ; value to write.
1274   8506 0C                 inc c               ; port 65526=write value to register.
1275   8507 ED 79              out (c),a           ; this is what we're putting there.
1276   8509 1C                 inc e               ; next sound chip register.
1277   850A 23                 inc hl              ; next byte to write.
1278   850B 15                 dec d               ; decrement loop counter.
1279   850C C2 01 85           jp nz,w8912a        ; repeat until done.
1280   850F C9                 ret
1281   8510             
1282   8510 00 00       snddat defw 0              ; tone registers, channel A.
1283   8512 00 00              defw 0              ; channel B tone registers.
1284   8514 00 00              defw 0              ; as above, channel C.
1285   8516 00          sndwnp defb 0              ; white noise period.
1286   8517 3C          sndmix defb 60             ; tone/noise mixer control.
1287   8518 00          sndv1  defb 0              ; channel A amplitude/envelope generator.
1288   8519 00          sndv2  defb 0              ; channel B amplitude/envelope.
1289   851A 00          sndv3  defb 0              ; channel C amplitude/envelope.
1290   851B 00 00              defw 0              ; duration of each note.
1291   851D 00                 defb 0
1292   851E             
1293   851E 23          plwn   inc hl              ; next byte of sound.
1294   851F E6 38              and 56              ; check if we're bothering with white noise.
1295   8521 C0                 ret nz              ; we're not.
1296   8522 7E                 ld a,(hl)           ; fetch byte.
1297   8523 32 16 85           ld (sndwnp),a       ; set white noise period.
1298   8526 C9                 ret
1299   8527             
1300   8527             
1301   8527 CD BD 85    plsnd2 call cksnd2         ; check sound for first channel.
1302   852A FE FF              cp 255              ; reached end?
1303   852C 28 70              jr z,silen2         ; silence this channel.
1304   852E E6 0F              and 15              ; sound bits.
1305   8530 32 19 85           ld (sndv2),a        ; set volume for channel.
1306   8533 3A 17 85           ld a,(sndmix)       ; mixer byte.
1307   8536 E6 ED              and 237             ; remove bits for this channel.
1308   8538 47                 ld b,a              ; store in b register.
1309   8539 CD 7D 85           call plmix          ; fetch mixer details.
1310   853C E6 12              and 18              ; mixer bits we want.
1311   853E B0                 or b                ; combine with mixer bits.
1312   853F 32 17 85           ld (sndmix),a       ; new mixer value.
1313   8542 CD 1E 85           call plwn           ; white noise check.
1314   8545 23                 inc hl              ; tone low.
1315   8546 5E                 ld e,(hl)           ; fetch value.
1316   8547 23                 inc hl              ; tone high.
1317   8548 56                 ld d,(hl)           ; fetch value.
1318   8549 ED 53 12 85        ld (snddat+2),de    ; set tone.
1319   854D 23                 inc hl              ; next bit of sound.
1320   854E 22 F5 84           ld (ch2ptr),hl      ; set pointer.
1321   8551 C9                 ret
1322   8552             
1323   8552 CD C2 85    plsnd3 call cksnd3         ; check sound for first channel.
1324   8555 FE FF              cp 255              ; reached end?
1325   8557 28 52              jr z,silen3         ; silence last channel.
1326   8559 E6 0F              and 15              ; sound bits.
1327   855B 32 1A 85           ld (sndv3),a        ; set volume for channel.
1328   855E 3A 17 85           ld a,(sndmix)       ; mixer byte.
1329   8561 E6 DB              and 219             ; remove bits for this channel.
1330   8563 47                 ld b,a              ; store in b register.
1331   8564 CD 7D 85           call plmix          ; fetch mixer details.
1332   8567 E6 24              and 36              ; mixer bits we want.
1333   8569 B0                 or b                ; combine with mixer bits.
1334   856A 32 17 85           ld (sndmix),a       ; new mixer value.
1335   856D CD 1E 85           call plwn           ; white noise check.
1336   8570 23                 inc hl              ; tone low.
1337   8571 5E                 ld e,(hl)           ; fetch value.
1338   8572 23                 inc hl              ; tone high.
1339   8573 56                 ld d,(hl)           ; fetch value.
1340   8574 ED 53 14 85        ld (snddat+4),de    ; set tone.
1341   8578 23                 inc hl              ; next bit of sound.
1342   8579 22 F7 84           ld (ch3ptr),hl      ; set pointer.
1343   857C C9                 ret
1344   857D             
1345   857D 7E          plmix  ld a,(hl)           ; fetch mixer byte.
1346   857E E6 C0              and 192             ; mix bits are d6 and d7.
1347   8580 07                 rlca                ; rotate into d0 and d1.
1348   8581 07                 rlca
1349   8582 5F                 ld e,a              ; displacement in de.
1350   8583 16 00              ld d,0
1351   8585 E5                 push hl             ; store pointer on stack.
1352   8586 21 8D 85           ld hl,mixtab        ; mixer table.
1353   8589 19                 add hl,de           ; point to mixer byte.
1354   858A 7E                 ld a,(hl)           ; fetch mixer value.
1355   858B E1                 pop hl              ; restore pointer.
1356   858C C9                 ret
1357   858D 3F 38 07 00 mixtab defb 63,56,7,0      ; mixer byte settings.
1358   8591             
1359   8591 AF          silen1 xor a               ; zero.
1360   8592 32 18 85           ld (sndv1),a        ; sound off.
1361   8595 3A 17 85           ld a,(sndmix)       ; mixer byte.
1362   8598 F6 09              or 9                ; mix bits off.
1363   859A 32 17 85           ld (sndmix),a       ; mixer setting for channel.
1364   859D C9                 ret
1365   859E AF          silen2 xor a               ; zero.
1366   859F 32 19 85           ld (sndv2),a        ; sound off.
1367   85A2 3A 17 85           ld a,(sndmix)       ; mixer byte.
1368   85A5 F6 12              or 18               ; mix bits off.
1369   85A7 32 17 85           ld (sndmix),a       ; mixer setting for channel.
1370   85AA C9                 ret
1371   85AB AF          silen3 xor a               ; zero.
1372   85AC 32 1A 85           ld (sndv3),a        ; sound off.
1373   85AF 3A 17 85           ld a,(sndmix)       ; mixer byte.
1374   85B2 F6 24              or 36               ; mix bits off.
1375   85B4 32 17 85           ld (sndmix),a       ; mixer setting for channel.
1376   85B7 C9                 ret
1377   85B8 2A F3 84    cksnd1 ld hl,(ch1ptr)      ; pointer to sound.
1378   85BB 7E                 ld a,(hl)           ; fetch mixer/flag.
1379   85BC C9                 ret
1380   85BD 2A F5 84    cksnd2 ld hl,(ch2ptr)      ; pointer to sound.
1381   85C0 7E                 ld a,(hl)           ; fetch mixer/flag.
1382   85C1 C9                 ret
1383   85C2 2A F7 84    cksnd3 ld hl,(ch3ptr)      ; pointer to sound.
1384   85C5 7E                 ld a,(hl)           ; fetch mixer/flag.
1385   85C6 C9                 ret
1386   85C7             
1387   85C7 CD B8 85    plsnd1 call cksnd1         ; check sound for first channel.
1388   85CA FE FF              cp 255              ; reached end?
1389   85CC 28 C3              jr z,silen1         ; silence first channel.
1390   85CE E6 0F              and 15              ; sound bits.
1391   85D0 32 18 85           ld (sndv1),a        ; set volume for channel.
1392   85D3 3A 17 85           ld a,(sndmix)       ; mixer byte.
1393   85D6 E6 F6              and 246             ; remove bits for this channel.
1394   85D8 47                 ld b,a              ; store in b register.
1395   85D9 CD 7D 85           call plmix          ; fetch mixer details.
1396   85DC E6 09              and 9               ; mixer bits we want.
1397   85DE B0                 or b                ; combine with mixer bits.
1398   85DF 32 17 85           ld (sndmix),a       ; new mixer value.
1399   85E2 CD 1E 85           call plwn           ; white noise check.
1400   85E5 23                 inc hl              ; tone low.
1401   85E6 5E                 ld e,(hl)           ; fetch value.
1402   85E7 23                 inc hl              ; tone high.
1403   85E8 56                 ld d,(hl)           ; fetch value.
1404   85E9 ED 53 10 85        ld (snddat),de      ; set tone.
1405   85ED 23                 inc hl              ; next bit of sound.
1406   85EE 22 F3 84           ld (ch1ptr),hl      ; set pointer.
1407   85F1 C9                 ret
1408   85F2             
1409   85F2             
1410   85F2             ; Objects handling.
1411   85F2             ; 32 bytes for image
1412   85F2             ; 1 for colour
1413   85F2             ; 3 for room, x and y
1414   85F2             ; 3 for starting room, x and y.
1415   85F2             ; 254 = disabled.
1416   85F2             ; 255 = object in player's pockets.
1417   85F2             
1418   85F2             ; Show items present.
1419   85F2             
1420   85F2 21 F3 C7    shwob  ld hl,objdta        ; objects table.
1421   85F5 11 20 00           ld de,32            ; distance to room number.
1422   85F8 19                 add hl,de           ; point to room data.
1423   85F9 3A 0F 7D           ld a,(numob)        ; number of objects in the game.
1424   85FC 47                 ld b,a              ; loop counter.
1425   85FD C5          shwob0 push bc             ; store count.
1426   85FE E5                 push hl             ; store item pointer.
1427   85FF 3A 14 7D           ld a,(scno)         ; current location.
1428   8602 BE                 cp (hl)             ; same as an item?
1429   8603 CC 0F 86           call z,dobj         ; yes, display object.
1430   8606 E1                 pop hl              ; restore pointer.
1431   8607 C1                 pop bc              ; restore counter.
1432   8608 11 26 00           ld de,38            ; distance to next item.
1433   860B 19                 add hl,de           ; point to it.
1434   860C 10 EF              djnz shwob0         ; repeat for others.
1435   860E C9                 ret
1436   860F             
1437   860F             ; Display object.
1438   860F             ; hl must point to object's room number.
1439   860F             
1440   860F 23          dobj   inc hl              ; point to x.
1441   8610 11 3A 7D    dobj0  ld de,dispx         ; coordinates.
1442   8613 ED A0              ldi                 ; transfer x coord.
1443   8615 ED A0              ldi                 ; transfer y too.
1444   8617 11 DD FF           ld de,65501         ; minus 35.
1445   861A 19                 add hl,de           ; point to image.
1446   861B C3 B0 88    dobj1  jp sprite           ; draw this sprite.
1447   861E             
1448   861E             ; Colour an object/sprite at dispx, dispy.
1449   861E             ; set up colour in c register first.
1450   861E             
1451   861E E5          cobj   push hl             ; store sprite graphic address.
1452   861F CD E0 8D           call scadd          ; get screen address in hl.
1453   8622 CB EC              set 5,h             ; switch to attribute screen.
1454   8624 16 03              ld d,3              ; default columns to write.
1455   8626 3A 3B 7D           ld a,(dispy)        ; y position.
1456   8629 E6 07              and 7               ; does y straddle cells?
1457   862B 20 01              jr nz,cobj0         ; yes, loop counter is good.
1458   862D 15                 dec d               ; one less column to write.
1459   862E 06 10       cobj0  ld b,16             ; rows to write.
1460   8630 C5          cobj2  push bc             ; store row counter.
1461   8631 42                 ld b,d              ; column counter.
1462   8632 E5                 push hl             ; store address.
1463   8633 71          cobj1  ld (hl),c           ; write attribute.
1464   8634 23                 inc hl              ; next cell.
1465   8635 10 FC              djnz cobj1          ; repeat for columns.
1466   8637 E1                 pop hl              ; restore attribute address.
1467   8638 CD BE 8E           call nattr          ; next attribute address in hl.
1468   863B C1                 pop bc              ; restore row counter.
1469   863C 10 F2              djnz cobj2          ; repeat for all rows.
1470   863E E1                 pop hl
1471   863F C9                 ret
1472   8640             
1473   8640             ; Remove an object.
1474   8640             
1475   8640 21 0F 7D    remob  ld hl,numob         ; number of objects in game.
1476   8643 BE                 cp (hl)             ; are we checking past the end?
1477   8644 D0                 ret nc              ; yes, can't get non-existent item.
1478   8645 F5                 push af             ; remember object.
1479   8646 CD 50 86           call getob          ; pick it up if we haven't already got it.
1480   8649 F1                 pop af              ; retrieve object number.
1481   864A CD 7E 86           call gotob          ; get its address.
1482   864D 36 FE              ld (hl),254         ; remove it.
1483   864F C9                 ret
1484   8650             
1485   8650             ; Pick up object number held in the accumulator.
1486   8650             
1487   8650 21 0F 7D    getob  ld hl,numob         ; number of objects in game.
1488   8653 BE                 cp (hl)             ; are we checking past the end?
1489   8654 D0                 ret nc              ; yes, can't get non-existent item.
1490   8655 CD 7E 86           call gotob          ; check if we already have it.
1491   8658 C8                 ret z               ; we already do.
1492   8659 EB                 ex de,hl            ; object address in de.
1493   865A 21 14 7D           ld hl,scno          ; current screen.
1494   865D BE                 cp (hl)             ; is it on this screen?
1495   865E EB                 ex de,hl            ; object address back in hl.
1496   865F 20 1A              jr nz,getob0        ; not on screen, so nothing to delete.
1497   8661 36 FF              ld (hl),255         ; pick it up.
1498   8663 23                 inc hl              ; point to x coord.
1499   8664 5E          getob1 ld e,(hl)           ; x coord.
1500   8665 23                 inc hl              ; back to y coord.
1501   8666 56                 ld d,(hl)           ; y coord.
1502   8667 ED 53 3A 7D        ld (dispx),de       ; set display coords.
1503   866B 11 DE FF           ld de,65502         ; minus graphic size.
1504   866E 19                 add hl,de           ; point to graphics.
1505   866F CD 1B 86           call dobj1          ; delete object sprite.
1506   8672 3A 4E 94           ld a,(chgfx+1)      ; first block colour.
1507   8675 E6 07              and 7               ; only want ink attribute.
1508   8677 4F                 ld c,a              ; set up colour.
1509   8678 C3 1E 86           jp cobj             ; colour object's old position.
1510   867B 36 FF       getob0 ld (hl),255         ; pick it up.
1511   867D C9                 ret
1512   867E             
1513   867E             ; Got object check.
1514   867E             ; Call with object in accumulator, returns zero set if in pockets.
1515   867E             
1516   867E 21 0F 7D    gotob  ld hl,numob         ; number of objects in game.
1517   8681 BE                 cp (hl)             ; are we checking past the end?
1518   8682 30 06              jr nc,gotob0        ; yes, we can't have a non-existent object.
1519   8684 CD 8E 86           call findob         ; find the object.
1520   8687 FE FF       gotob1 cp 255              ; in pockets?
1521   8689 C9                 ret
1522   868A 3E FE       gotob0 ld a,254            ; missing.
1523   868C 18 F9              jr gotob1
1524   868E             
1525   868E 21 F3 C7    findob ld hl,objdta        ; objects.
1526   8691 11 26 00           ld de,38            ; size of each object.
1527   8694 A7                 and a               ; is it zero?
1528   8695 28 04              jr z,fndob1         ; yes, skip loop.
1529   8697 47                 ld b,a              ; loop counter in b.
1530   8698 19          fndob2 add hl,de           ; point to next one.
1531   8699 10 FD              djnz fndob2         ; repeat until we find address.
1532   869B 1E 20       fndob1 ld e,32             ; distance to room it's in.
1533   869D 19                 add hl,de           ; point to room.
1534   869E 7E                 ld a,(hl)           ; fetch status.
1535   869F C9                 ret
1536   86A0             
1537   86A0             ; Drop object number at (dispx, dispy).
1538   86A0             
1539   86A0 21 0F 7D    drpob  ld hl,numob         ; number of objects in game.
1540   86A3 BE                 cp (hl)             ; are we checking past the end?
1541   86A4 D0                 ret nc              ; yes, can't drop non-existent item.
1542   86A5 CD 7E 86           call gotob          ; make sure object is in inventory.
1543   86A8 3A 14 7D           ld a,(scno)         ; screen number.
1544   86AB BE                 cp (hl)             ; already on this screen?
1545   86AC C8                 ret z               ; yes, nothing to do.
1546   86AD 77                 ld (hl),a           ; bring onto screen.
1547   86AE 23                 inc hl              ; point to x coord.
1548   86AF 3A 3A 7D           ld a,(dispx)        ; sprite x coordinate.
1549   86B2 77                 ld (hl),a           ; set x coord.
1550   86B3 23                 inc hl              ; point to object y.
1551   86B4 3A 3B 7D           ld a,(dispy)        ; sprite y coordinate.
1552   86B7 77                 ld (hl),a           ; set the y position.
1553   86B8             ;       ld de,65502         ; minus graphic size.
1554   86B8             ;       add hl,de           ; point to graphics.
1555   86B8 2B                 dec hl              ; back to x.
1556   86B9 C3 10 86           jp dobj0            ; draw the object sprite.
1557   86BC             
1558   86BC             ; Seek objects at sprite position.
1559   86BC             
1560   86BC 21 F3 C7    skobj  ld hl,objdta        ; pointer to objects.
1561   86BF 11 20 00           ld de,32            ; distance to room number.
1562   86C2 19                 add hl,de           ; point to room data.
1563   86C3 11 26 00           ld de,38            ; size of each object.
1564   86C6 3A 0F 7D           ld a,(numob)        ; number of objects in game.
1565   86C9 47                 ld b,a              ; set up the loop counter.
1566   86CA 3A 14 7D    skobj0 ld a,(scno)         ; current room number.
1567   86CD BE                 cp (hl)             ; is object in here?
1568   86CE CC D7 86           call z,skobj1       ; yes, check coordinates.
1569   86D1 19                 add hl,de           ; point to next object in table.
1570   86D2 10 F6              djnz skobj0         ; repeat for all objects.
1571   86D4 3E FF              ld a,255            ; end of list and nothing found, return 255.
1572   86D6 C9                 ret
1573   86D7 23          skobj1 inc hl              ; point to x coordinate.
1574   86D8 7E                 ld a,(hl)           ; get coordinate.
1575   86D9 DD 96 08           sub (ix+8)          ; subtract sprite x.
1576   86DC C6 0F              add a,15            ; add sprite height minus one.
1577   86DE FE 1F              cp 31               ; within range?
1578   86E0 D2 F6 86           jp nc,skobj2        ; no, ignore object.
1579   86E3 23                 inc hl              ; point to y coordinate now.
1580   86E4 7E                 ld a,(hl)           ; get coordinate.
1581   86E5 DD 96 09           sub (ix+9)          ; subtract the sprite y.
1582   86E8 C6 0F              add a,15            ; add sprite width minus one.
1583   86EA FE 1F              cp 31               ; within range?
1584   86EC D2 F5 86           jp nc,skobj3        ; no, ignore object.
1585   86EF D1                 pop de              ; remove return address from stack.
1586   86F0 3A 0F 7D           ld a,(numob)        ; objects in game.
1587   86F3 90                 sub b               ; subtract loop counter.
1588   86F4 C9                 ret                 ; accumulator now points to object.
1589   86F5 2B          skobj3 dec hl              ; back to y position.
1590   86F6 2B          skobj2 dec hl              ; back to room.
1591   86F7 C9                 ret
1592   86F8             
1593   86F8             
1594   86F8             ; Spawn a new sprite.
1595   86F8             
1596   86F8 21 6C 92    spawn  ld hl,sprtab        ; sprite table.
1597   86FB 3E 0C       numsp1 ld a,NUMSPR         ; number of sprites.
1598   86FD 11 11 00           ld de,TABSIZ        ; size of each entry.
1599   8700 08          spaw0  ex af,af'           ; store loop counter.
1600   8701 7E                 ld a,(hl)           ; get sprite type.
1601   8702 3C                 inc a               ; is it an unused slot?
1602   8703 28 05              jr z,spaw1          ; yes, we can use this one.
1603   8705 19                 add hl,de           ; point to next sprite in table.
1604   8706 08                 ex af,af'           ; restore loop counter.
1605   8707 3D                 dec a               ; one less iteration.
1606   8708 20 F6              jr nz,spaw0         ; keep going until we find a slot.
1607   870A             
1608   870A             ; Didn't find one but drop through and set up a dummy sprite instead.
1609   870A             
1610   870A DD E5       spaw1  push ix             ; existing sprite address on stack.
1611   870C 22 47 87           ld (spptr),hl       ; store spawned sprite address.
1612   870F 71                 ld (hl),c           ; set the type.
1613   8710 23                 inc hl              ; point to image.
1614   8711 70                 ld (hl),b           ; set the image.
1615   8712 23                 inc hl              ; next byte.
1616   8713 36 00              ld (hl),0           ; frame zero.
1617   8715 23                 inc hl              ; next byte.
1618   8716 DD 7E 08           ld a,(ix+X)         ; x coordinate.
1619   8719 77                 ld (hl),a           ; set sprite coordinate.
1620   871A 23                 inc hl              ; next byte.
1621   871B DD 7E 09           ld a,(ix+Y)         ; y coordinate.
1622   871E 77                 ld (hl),a           ; set sprite coordinate.
1623   871F 23                 inc hl              ; next byte.
1624   8720 EB                 ex de,hl            ; swap address into de.
1625   8721 2A 47 87           ld hl,(spptr)       ; restore address of details.
1626   8724 01 05 00           ld bc,5             ; number of bytes to duplicate.
1627   8727 ED B0              ldir                ; copy first version to new version.
1628   8729 EB                 ex de,hl            ; swap address into de.
1629   872A DD 7E 0A           ld a,(ix+10)        ; direction of original.
1630   872D 77                 ld (hl),a           ; set the direction.
1631   872E 23                 inc hl              ; next byte.
1632   872F 70                 ld (hl),b           ; reset parameter.
1633   8730 23                 inc hl              ; next byte.
1634   8731 70                 ld (hl),b           ; reset parameter.
1635   8732 23                 inc hl              ; next byte.
1636   8733 70                 ld (hl),b           ; reset parameter.
1637   8734 23                 inc hl              ; next byte.
1638   8735 70                 ld (hl),b           ; reset parameter.
1639   8736 DD 2A 47 87 rtssp  ld ix,(spptr)       ; address of new sprite.
1640   873A CD 3F 94    evis1  call evnt09         ; call sprite initialisation event.
1641   873D DD 2A 47 87        ld ix,(spptr)       ; address of new sprite.
1642   8741 CD FD 8D           call sspria         ; display the new sprite.
1643   8744 DD E1              pop ix              ; address of original sprite.
1644   8746 C9                 ret
1645   8747             
1646   8747 00 00       spptr  defw 0              ; spawned sprite pointer.
1647   8749 00          seed   defb 0              ; seed for random numbers.
1648   874A             score  defb '000000'       ; player's score.
1648   874A 303030303030
1649   8750             hiscor defb '000000'       ; high score.
1649   8750 303030303030
1650   8756             bonus  defb '000000'       ; bonus.
1650   8756 303030303030
1651   875C 00 3C       grbase defw 15360          ; graphics base address.
1652   875E             
1653   875E 7B          checkx ld a,e              ; x position.
1654   875F FE 18              cp 24               ; off screen?
1655   8761 D8                 ret c               ; no, it's okay.
1656   8762 E1                 pop hl              ; remove return address from stack.
1657   8763 C9                 ret
1658   8764             
1659   8764             ; Displays the current score.
1660   8764             
1661   8764 CD 7F 8C    dscor  call preprt         ; set up font and print position.
1662   8767 CD 5E 87           call checkx         ; make sure we're in a printable range.
1663   876A 3A EE 8B           ld a,(prtmod)       ; get print mode.
1664   876D A7                 and a               ; standard size text?
1665   876E C2 87 87           jp nz,bscor0        ; no, show double-height.
1666   8771 C5          dscor0 push bc             ; place counter onto the stack.
1667   8772 E5                 push hl
1668   8773 7E                 ld a,(hl)           ; fetch character.
1669   8774 CD 2F 88           call pchar          ; display character.
1670   8777             ;       call gaadd          ; get attribute address.
1671   8777             ;       ld a,(23693)        ; current cell colours.
1672   8777             ;       ld (hl),a           ; write to attribute cell.
1673   8777 21 3B 7D           ld hl,dispy         ; y coordinate.
1674   877A 34                 inc (hl)            ; move along one.
1675   877B E1                 pop hl
1676   877C 23                 inc hl              ; next score column.
1677   877D C1                 pop bc              ; retrieve character counter.
1678   877E 10 F1              djnz dscor0         ; repeat for all digits.
1679   8780 2A 3A 7D    dscor2 ld hl,(dispx)       ; general coordinates.
1680   8783 22 2F 7D           ld (charx),hl       ; set up display coordinates.
1681   8786 C9                 ret
1682   8787             
1683   8787             ; Displays the current score in double-height characters.
1684   8787             
1685   8787 C5          bscor0 push bc             ; place counter onto the stack.
1686   8788 E5                 push hl
1687   8789 7E                 ld a,(hl)           ; fetch character.
1688   878A CD 12 8C           call bchar          ; display big char.
1689   878D E1                 pop hl
1690   878E 23                 inc hl              ; next score column.
1691   878F C1                 pop bc              ; retrieve character counter.
1692   8790 10 F5              djnz bscor0         ; repeat for all digits.
1693   8792 C3 80 87           jp dscor2           ; tidy up line and column variables.
1694   8795             
1695   8795             ; Adds number in the hl pair to the score.
1696   8795             
1697   8795 11 4B 87    addsc  ld de,score+1       ; ten thousands column.
1698   8798 01 10 27           ld bc,10000         ; amount to add each time.
1699   879B CD B7 87           call incsc          ; add to score.
1700   879E 13                 inc de              ; thousands column.
1701   879F 01 E8 03           ld bc,1000          ; amount to add each time.
1702   87A2 CD B7 87           call incsc          ; add to score.
1703   87A5 13                 inc de              ; hundreds column.
1704   87A6 01 64 00           ld bc,100           ; amount to add each time.
1705   87A9 CD B7 87           call incsc          ; add to score.
1706   87AC 13                 inc de              ; tens column.
1707   87AD 01 0A 00           ld bc,10            ; amount to add each time.
1708   87B0 CD B7 87           call incsc          ; add to score.
1709   87B3 13                 inc de              ; units column.
1710   87B4 01 01 00           ld bc,1             ; units.
1711   87B7 E5          incsc  push hl             ; store amount to add.
1712   87B8 A7                 and a               ; clear the carry flag.
1713   87B9 ED 42              sbc hl,bc           ; subtract from amount to add.
1714   87BB 38 09              jr c,incsc0         ; too much, restore value.
1715   87BD F1                 pop af              ; delete the previous amount from the stack.
1716   87BE D5                 push de             ; store column position.
1717   87BF CD C8 87           call incsc2         ; do the increment.
1718   87C2 D1                 pop de              ; restore column.
1719   87C3 C3 B7 87           jp incsc            ; repeat until all added.
1720   87C6 E1          incsc0 pop hl              ; restore previous value.
1721   87C7 C9                 ret
1722   87C8 1A          incsc2 ld a,(de)           ; get amount.
1723   87C9 3C                 inc a               ; add one to column.
1724   87CA 12                 ld (de),a           ; write new column total.
1725   87CB FE 3A              cp '9'+1            ; gone beyond range of digits?
1726   87CD D8                 ret c               ; no, carry on.
1727   87CE 3E 30              ld a,'0'            ; mae it zero.
1728   87D0 12                 ld (de),a           ; write new column total.
1729   87D1 1B                 dec de              ; back one column.
1730   87D2 18 F4              jr incsc2
1731   87D4             
1732   87D4             ; Add bonus to score.
1733   87D4             
1734   87D4 11 4F 87    addbo  ld de,score+5       ; last score digit.
1735   87D7 21 5B 87           ld hl,bonus+5       ; last bonus digit.
1736   87DA A7                 and a               ; clear carry.
1737   87DB 01 30 06           ld bc,6*256+48      ; 6 digits to add, ASCII '0' in c.
1738   87DE 1A          addbo0 ld a,(de)           ; get score.
1739   87DF 8E                 adc a,(hl)          ; add bonus.
1740   87E0 91                 sub c               ; 0 to 18.
1741   87E1 71                 ld (hl),c           ; zeroise bonus.
1742   87E2 2B                 dec hl              ; next bonus.
1743   87E3 FE 3A              cp 58               ; carried?
1744   87E5 38 02              jr c,addbo1         ; no, do next one.
1745   87E7 D6 0A              sub 10              ; subtract 10.
1746   87E9 12          addbo1 ld (de),a           ; write new score.
1747   87EA 1B                 dec de              ; next score digit.
1748   87EB 3F                 ccf                 ; set carry for next digit.
1749   87EC 10 F0              djnz addbo0         ; repeat for all 6 digits.
1750   87EE C9                 ret
1751   87EF             
1752   87EF             ; Swap score and bonus.
1753   87EF             
1754   87EF 11 4A 87    swpsb  ld de,score         ; first score digit.
1755   87F2 21 56 87           ld hl,bonus         ; first bonus digit.
1756   87F5 06 06              ld b,6              ; digits to add.
1757   87F7 1A          swpsb0 ld a,(de)           ; get score and bonus digits.
1758   87F8 4E                 ld c,(hl)
1759   87F9 EB                 ex de,hl            ; swap pointers.
1760   87FA 71                 ld (hl),c           ; write bonus and score digits.
1761   87FB 12                 ld (de),a
1762   87FC 23                 inc hl              ; next score and bonus.
1763   87FD 13                 inc de
1764   87FE 10 F7              djnz swpsb0         ; repeat for all 6 digits.
1765   8800 C9                 ret
1766   8801             
1767   8801             ; Get print address.
1768   8801             
1769   8801 3A 3A 7D    gprad  ld a,(dispx)        ; returns scr. add. in de.
1770   8804 5F                 ld e,a              ; place in e for now.
1771   8805 E6 18              and 24              ; which of 3 segments do we need?
1772   8807 C6 40              add a,64            ; add 64 for start address of screen.
1773   8809 57                 ld d,a              ; that's our high byte.
1774   880A 7B                 ld a,e              ; restore x coordinate.
1775   880B 0F                 rrca                ; multiply by 32.
1776   880C 0F                 rrca
1777   880D 0F                 rrca
1778   880E E6 E0              and 224             ; lines within segment.
1779   8810 5F                 ld e,a              ; set up low byte for x.
1780   8811 3A 3B 7D           ld a,(dispy)        ; now get y coordinate.
1781   8814 83                 add a,e             ; add to low byte.
1782   8815 5F                 ld e,a              ; final low byte.
1783   8816 C9                 ret
1784   8817             
1785   8817             ; Get property buffer address of char at (dispx, dispy) in hl.
1786   8817             
1787   8817 3A 3A 7D    pradd  ld a,(dispx)        ; x coordinate.
1788   881A 0F                 rrca                ; multiply by 32.
1789   881B 0F                 rrca
1790   881C 0F                 rrca
1791   881D 6F                 ld l,a              ; store shift in l.
1792   881E E6 03              and 3               ; high byte bits.
1793   8820 C6 58              add a,88            ; 88 * 256 = 22528, start of properties map.
1794   8822 67                 ld h,a              ; that's our high byte.
1795   8823 7D                 ld a,l              ; restore shift result.
1796   8824 E6 E0              and 224             ; only want low bits.
1797   8826 6F                 ld l,a              ; put into low byte.
1798   8827 3A 3B 7D           ld a,(dispy)        ; fetch y coordinate.
1799   882A E6 1F              and 31              ; should be in range 0 - 31.
1800   882C 85                 add a,l             ; add to low byte.
1801   882D 6F                 ld l,a              ; new low byte.
1802   882E C9                 ret
1803   882F             
1804   882F             ; Get attribute address of char at (dispx, dispy) in hl.
1805   882F             
1806   882F             ;gaadd  ld a,(dispx)        ; x coordinate.
1807   882F             ;       rrca                ; multiply by 32.
1808   882F             ;       rrca
1809   882F             ;       rrca
1810   882F             ;       ld l,a              ; store shift in l.
1811   882F             ;       and 3               ; high byte bits.
1812   882F             ;       add a,88            ; 88 * 256 = 22528, start of screen attributes.
1813   882F             ;       ld h,a              ; that's our high byte.
1814   882F             ;       ld a,l              ; restore shift result.
1815   882F             ;       and 224             ; only want low bits.
1816   882F             ;       ld l,a              ; put into low byte.
1817   882F             ;       ld a,(dispy)        ; fetch y coordinate.
1818   882F             ;       and 31              ; should be in range 0 - 31.
1819   882F             ;       add a,l             ; add to low byte.
1820   882F             ;       ld l,a              ; new low byte.
1821   882F             ;       ret
1822   882F             
1823   882F 07          pchar  rlca                ; multiply char by 8.
1824   8830 07                 rlca
1825   8831 07                 rlca
1826   8832 5F                 ld e,a              ; store shift in e.
1827   8833 E6 07              and 7               ; only want high byte bits.
1828   8835 57                 ld d,a              ; store in d.
1829   8836 7B                 ld a,e              ; restore shifted value.
1830   8837 E6 F8              and 248             ; only want low byte bits.
1831   8839 5F                 ld e,a              ; that's the low byte.
1832   883A 2A 36 5C           ld hl,(23606)       ; address of character set.
1833   883D 19                 add hl,de           ; add displacement.
1834   883E CD 01 88    pchark call gprad          ; get screen address.
1835   8841             
1836   8841 3A 8D 5C           ld a,(23693)        ; get attribute value.
1837   8844 4F                 ld c,a              ; store in c register.
1838   8845 06 08              ld b,8              ; lines to write.
1839   8847 7E          pchar0 ld a,(hl)           ; get image byte.
1840   8848 12                 ld (de),a           ; copy to screen.
1841   8849 23                 inc hl              ; next image byte.
1842   884A CB EA              set 5,d             ; select attribute screen.
1843   884C 79                 ld a,c              ; get attribute.
1844   884D 12                 ld (de),a           ; write to screen.
1845   884E CB AA              res 5,d
1846   8850 14                 inc d               ; next screen row down.
1847   8851 10 F4              djnz pchar0         ; repeat.
1848   8853 C9                 ret
1849   8854             
1850   8854             ; Print attributes, properties and pixels.
1851   8854             
1852   8854 00          colpat defb 0
1853   8855             
1854   8855 47          pattr  ld b,a              ; store cell in b register for now.
1855   8856 5F                 ld e,a              ; displacement in e.
1856   8857 16 00              ld d,0              ; no high byte.
1857   8859 21 CD 96           ld hl,bprop         ; block properties.
1858   885C 19                 add hl,de           ; property cell address.
1859   885D 4E                 ld c,(hl)           ; fetch byte.
1860   885E 79                 ld a,c              ; put into accumulator.
1861   885F FE 08              cp COLECT           ; is it a collectable?
1862   8861 C2 68 88           jp nz,pattr1        ; no, carry on as normal.
1863   8864 78                 ld a,b              ; restore cell.
1864   8865 32 54 88           ld (colpat),a       ; store collectable block.
1865   8868 CD 17 88    pattr1 call pradd          ; get property buffer address.
1866   886B 71                 ld (hl),c           ; write property.
1867   886C 78                 ld a,b              ; get block number.
1868   886D             
1869   886D             ; Print attributes, no properties.
1870   886D             
1871   886D 07          panp   rlca                ; multiply char by 16.
1872   886E 07                 rlca
1873   886F 07                 rlca
1874   8870 07                 rlca
1875   8871 5F                 ld e,a              ; store shift in e.
1876   8872 E6 0F              and 15              ; only want high byte bits.
1877   8874 57                 ld d,a              ; store in d.
1878   8875 7B                 ld a,e              ; restore shifted value.
1879   8876 E6 F0              and 240             ; only want low byte bits.
1880   8878 5F                 ld e,a              ; that's the low byte.
1881   8879 21 4D 94           ld hl,chgfx         ; address of graphics.
1882   887C 19                 add hl,de           ; add displacement.
1883   887D CD 01 88           call gprad          ; get screen address.
1884   8880 06 08              ld b,8              ; number of pixel rows to write.
1885   8882 7E          panp0  ld a,(hl)           ; get image byte.
1886   8883 12                 ld (de),a           ; copy to screen.
1887   8884 23                 inc hl              ; next image byte.
1888   8885 CB EA              set 5,d             ; attribute screen.
1889   8887 7E                 ld a,(hl)           ; get image byte.
1890   8888 12                 ld (de),a           ; copy to screen.
1891   8889 23                 inc hl              ; next image byte.
1892   888A CB AA              res 5,d             ; pixel screen.
1893   888C 14                 inc d               ; next screen row down.
1894   888D 10 F3              djnz panp0          ; repeat for 8 pixel rows.
1895   888F 21 3B 7D           ld hl,dispy         ; y coordinate.
1896   8892 34                 inc (hl)            ; move along one.
1897   8893 C9                 ret
1898   8894             
1899   8894             
1900   8894             ; Print character pixels, no more.
1901   8894             
1902   8894 CD 2F 88    pchr   call pchar          ; show character in accumulator.
1903   8897 21 3B 7D           ld hl,dispy         ; y coordinate.
1904   889A 34                 inc (hl)            ; move along one.
1905   889B C9                 ret
1906   889C             
1907   889C             ; Shifter sprite routine for objects.
1908   889C             
1909   889C EE 07       sprit7 xor 7
1910   889E 3C                 inc a
1911   889F CB 15       sprit3 rl l                ; shift into position.
1912   88A1 CB 11              rl c
1913   88A3 CB 14              rl h
1914   88A5 3D                 dec a               ; one less iteration.
1915   88A6 C2 9F 88           jp nz,sprit3
1916   88A9 7D                 ld a,l
1917   88AA 69                 ld l,c
1918   88AB 4C                 ld c,h
1919   88AC 67                 ld h,a
1920   88AD C3 D8 88           jp sprit0           ; now apply to screen.
1921   88B0             
1922   88B0 E5          sprite push hl             ; store sprite graphic address.
1923   88B1 CD E0 8D           call scadd          ; get screen address in hl.
1924   88B4 EB                 ex de,hl            ; switch to de.
1925   88B5 E1                 pop hl              ; restore graphic address.
1926   88B6 3A 3B 7D           ld a,(dispy)        ; y position.
1927   88B9 E6 07              and 7               ; position straddling cells.
1928   88BB 47                 ld b,a              ; store in b register.
1929   88BC 3E 10              ld a,16             ; pixel height.
1930   88BE 08          sprit1 ex af,af'
1931   88BF 4E                 ld c,(hl)           ; fetch first byte.
1932   88C0 23                 inc hl              ; next byte.
1933   88C1 E5                 push hl             ; store source address.
1934   88C2 6E                 ld l,(hl)
1935   88C3 26 00              ld h,0
1936   88C5 78                 ld a,b              ; position straddling cells.
1937   88C6 A7                 and a               ; is it zero?
1938   88C7 28 0F              jr z,sprit0         ; yes, apply to screen.
1939   88C9 FE 05              cp 5
1940   88CB 30 CF              jr nc,sprit7
1941   88CD A7                 and a               ; clear carry.
1942   88CE CB 19       sprit2 rr c
1943   88D0 CB 1D              rr l
1944   88D2 CB 1C              rr h
1945   88D4 3D                 dec a
1946   88D5 C2 CE 88           jp nz,sprit2
1947   88D8 1A          sprit0 ld a,(de)           ; fetch screen image.
1948   88D9 A9                 xor c               ; merge with graphic.
1949   88DA 12                 ld (de),a           ; write to screen.
1950   88DB 1C                 inc e               ; next screen byte.
1951   88DC 1A                 ld a,(de)           ; fetch screen image.
1952   88DD AD                 xor l               ; combine with graphic.
1953   88DE 12                 ld (de),a           ; write to screen.
1954   88DF 13                 inc de              ; next screen address.
1955   88E0 1A                 ld a,(de)           ; fetch screen image.
1956   88E1 AC                 xor h               ; combine with graphic.
1957   88E2 12                 ld (de),a           ; write to screen.
1958   88E3 1B                 dec de              ; left to middle byte.
1959   88E4 1D                 dec e               ; back to start byte.
1960   88E5 14                 inc d               ; increment line number.
1961   88E6 7A                 ld a,d              ; segment address.
1962   88E7 E6 07              and 7               ; reached end of segment?
1963   88E9 C2 F7 88           jp nz,sprit6        ; no, just do next line within cell.
1964   88EC 7B                 ld a,e              ; low byte.
1965   88ED C6 20              add a,32            ; look down.
1966   88EF 5F                 ld e,a              ; new address.
1967   88F0 DA F7 88           jp c,sprit6         ; done.
1968   88F3 7A                 ld a,d              ; high byte.
1969   88F4 D6 08              sub 8               ; start of segment.
1970   88F6 57                 ld d,a              ; new high byte.
1971   88F7 E1          sprit6 pop hl              ; restore source address.
1972   88F8 23                 inc hl              ; next source byte.
1973   88F9 08                 ex af,af'
1974   88FA 3D                 dec a
1975   88FB C2 BE 88           jp nz,sprit1
1976   88FE C9                 ret
1977   88FF             
1978   88FF             ; Get room address.
1979   88FF             
1980   88FF 3A 14 7D    groom  ld a,(scno)         ; screen number.
1981   8902 11 00 00    groomx ld de,0             ; start at zero.
1982   8905 21 8B A2           ld hl,scdat         ; pointer to screens.
1983   8908 A7                 and a               ; is it the first one?
1984   8909 28 0A       groom1 jr z,groom0         ; no more screens to skip.
1985   890B 4E                 ld c,(hl)           ; low byte of screen size.
1986   890C 23                 inc hl              ; point to high byte.
1987   890D 46                 ld b,(hl)           ; high byte of screen size.
1988   890E 23                 inc hl              ; next address.
1989   890F EB                 ex de,hl            ; put total in hl, pointer in de.
1990   8910 09                 add hl,bc           ; skip a screen.
1991   8911 EB                 ex de,hl            ; put total in de, pointer in hl.
1992   8912 3D                 dec a               ; one less iteration.
1993   8913 18 F4              jr groom1           ; loop until we reach the end.
1994   8915 21 8B A2    groom0 ld hl,scdat         ; pointer to screens.
1995   8918 19                 add hl,de           ; add displacement.
1996   8919 3A D7 C6           ld a,(numsc)        ; number of screens.
1997   891C 16 00              ld d,0              ; zeroise high byte.
1998   891E 5F                 ld e,a              ; displacement in de.
1999   891F 19                 add hl,de           ; add double displacement to address.
2000   8920 19                 add hl,de
2001   8921 C9                 ret
2002   8922             
2003   8922             ; Draw present room.
2004   8922             
2005   8922 3A 0B 7D    droom  ld a,(wintop)       ; window top.
2006   8925 32 3A 7D           ld (dispx),a        ; set x coordinate.
2007   8928 CD FF 88    droom2 call groom          ; get address of current room.
2008   892B AF                 xor a               ; zero in accumulator.
2009   892C 32 70 89           ld (comcnt),a       ; reset compression counter.
2010   892F 3A 0D 7D           ld a,(winhgt)       ; height of window.
2011   8932 F5          droom0 push af             ; store row counter.
2012   8933 3A 0C 7D           ld a,(winlft)       ; window left edge.
2013   8936 32 3B 7D           ld (dispy),a        ; set cursor position.
2014   8939 3A 0E 7D           ld a,(winwid)       ; width of window.
2015   893C F5          droom1 push af             ; store column counter.
2016   893D CD 55 89           call flbyt          ; decompress next byte on the fly.
2017   8940 E5                 push hl             ; store address of cell.
2018   8941 CD 55 88           call pattr          ; show attributes and block.
2019   8944 E1                 pop hl              ; restore cell address.
2020   8945 F1                 pop af              ; restore loop counter.
2021   8946 3D                 dec a               ; one less column.
2022   8947 20 F3              jr nz,droom1        ; repeat for entire line.
2023   8949 3A 3A 7D           ld a,(dispx)        ; x coord.
2024   894C 3C                 inc a               ; move down one line.
2025   894D 32 3A 7D           ld (dispx),a        ; set new position.
2026   8950 F1                 pop af              ; restore row counter.
2027   8951 3D                 dec a               ; one less row.
2028   8952 20 DE              jr nz,droom0        ; repeat for all rows.
2029   8954 C9                 ret
2030   8955             
2031   8955             ; Decompress bytes on-the-fly.
2032   8955             
2033   8955 3A 70 89    flbyt  ld a,(comcnt)       ; compression counter.
2034   8958 A7                 and a               ; any more to decompress?
2035   8959 20 0C              jr nz,flbyt1        ; yes.
2036   895B 7E                 ld a,(hl)           ; fetch next byte.
2037   895C 23                 inc hl              ; point to next cell.
2038   895D FE FF              cp 255              ; is this byte a control code?
2039   895F C0                 ret nz              ; no, this byte is uncompressed.
2040   8960 7E                 ld a,(hl)           ; fetch byte type.
2041   8961 32 6F 89           ld (combyt),a       ; set up the type.
2042   8964 23                 inc hl              ; point to quantity.
2043   8965 7E                 ld a,(hl)           ; get quantity.
2044   8966 23                 inc hl              ; point to next byte.
2045   8967 3D          flbyt1 dec a               ; one less.
2046   8968 32 70 89           ld (comcnt),a       ; store new quantity.
2047   896B 3A 6F 89           ld a,(combyt)       ; byte to expand.
2048   896E C9                 ret
2049   896F             
2050   896F             
2051   896F 00          combyt defb 0              ; byte type compressed.
2052   8970 00          comcnt defb 0              ; compression counter.
2053   8971             
2054   8971             ; Ladder down check.
2055   8971             
2056   8971 DD 7E 08    laddd  ld a,(ix+8)         ; x coordinate.
2057   8974 E6 FE              and 254             ; make it even.
2058   8976 DD 77 08           ld (ix+8),a         ; reset it.
2059   8979 DD 66 09           ld h,(ix+9)         ; y coordinate.
2060   897C C6 10       numsp5 add a,16            ; look down 16 pixels.
2061   897E 6F                 ld l,a              ; coords in hl.
2062   897F 18 0E              jr laddv
2063   8981             
2064   8981             ; Ladder up check.
2065   8981             
2066   8981 DD 7E 08    laddu  ld a,(ix+8)         ; x coordinate.
2067   8984 E6 FE              and 254             ; make it even.
2068   8986 DD 77 08           ld (ix+8),a         ; reset it.
2069   8989 DD 66 09           ld h,(ix+9)         ; y coordinate.
2070   898C C6 0E       numsp6 add a,14            ; look 2 pixels above feet.
2071   898E 6F                 ld l,a              ; coords in hl.
2072   898F 22 3A 7D    laddv  ld (dispx),hl       ; set up test coordinates.
2073   8992 CD DC 8A           call tstbl          ; get map address.
2074   8995 CD 46 8A           call ldchk          ; standard ladder check.
2075   8998 C0                 ret nz              ; no way through.
2076   8999 23                 inc hl              ; look right one cell.
2077   899A CD 46 8A           call ldchk          ; do the check.
2078   899D C0                 ret nz              ; impassable.
2079   899E 3A 3B 7D           ld a,(dispy)        ; y coordinate.
2080   89A1 E6 07              and 7               ; position straddling block cells.
2081   89A3 C8                 ret z               ; no more checks needed.
2082   89A4 23                 inc hl              ; look to third cell.
2083   89A5 CD 46 8A           call ldchk          ; do the check.
2084   89A8 C9                 ret                 ; return with zero flag set accordingly.
2085   89A9             
2086   89A9             ; Can go up check.
2087   89A9             
2088   89A9 DD 7E 08    cangu  ld a,(ix+8)         ; x coordinate.
2089   89AC DD 66 09           ld h,(ix+9)         ; y coordinate.
2090   89AF D6 02              sub 2               ; look up 2 pixels.
2091   89B1 6F                 ld l,a              ; coords in hl.
2092   89B2 22 3A 7D           ld (dispx),hl       ; set up test coordinates.
2093   89B5 CD DC 8A           call tstbl          ; get map address.
2094   89B8 CD 1C 8A           call lrchk          ; standard left/right check.
2095   89BB C0                 ret nz              ; no way through.
2096   89BC 23                 inc hl              ; look right one cell.
2097   89BD CD 1C 8A           call lrchk          ; do the check.
2098   89C0 C0                 ret nz              ; impassable.
2099   89C1 3A 3B 7D           ld a,(dispy)        ; y coordinate.
2100   89C4 E6 07              and 7               ; position straddling block cells.
2101   89C6 C8                 ret z               ; no more checks needed.
2102   89C7 23                 inc hl              ; look to third cell.
2103   89C8 CD 1C 8A           call lrchk          ; do the check.
2104   89CB C9                 ret                 ; return with zero flag set accordingly.
2105   89CC             
2106   89CC             ; Can go down check.
2107   89CC             
2108   89CC DD 7E 08    cangd  ld a,(ix+8)         ; x coordinate.
2109   89CF DD 66 09           ld h,(ix+9)         ; y coordinate.
2110   89D2 C6 10       numsp3 add a,16            ; look down 16 pixels.
2111   89D4 6F                 ld l,a              ; coords in hl.
2112   89D5 22 3A 7D           ld (dispx),hl       ; set up test coordinates.
2113   89D8 CD DC 8A           call tstbl          ; get map address.
2114   89DB CD 2A 8A           call plchk          ; block, platform check.
2115   89DE C0                 ret nz              ; no way through.
2116   89DF 23                 inc hl              ; look right one cell.
2117   89E0 CD 2A 8A           call plchk          ; block, platform check.
2118   89E3 C0                 ret nz              ; impassable.
2119   89E4 3A 3B 7D           ld a,(dispy)        ; y coordinate.
2120   89E7 E6 07              and 7               ; position straddling block cells.
2121   89E9 C8                 ret z               ; no more checks needed.
2122   89EA 23                 inc hl              ; look to third cell.
2123   89EB CD 2A 8A           call plchk          ; block, platform check.
2124   89EE C9                 ret                 ; return with zero flag set accordingly.
2125   89EF             
2126   89EF             ; Can go left check.
2127   89EF             
2128   89EF DD 6E 08    cangl  ld l,(ix+8)         ; x coordinate.
2129   89F2 DD 7E 09           ld a,(ix+9)         ; y coordinate.
2130   89F5 D6 02              sub 2               ; look left 2 pixels.
2131   89F7 67                 ld h,a              ; coords in hl.
2132   89F8 18 09              jr cangh            ; test if we can go there.
2133   89FA             
2134   89FA             ; Can go right check.
2135   89FA             
2136   89FA DD 6E 08    cangr  ld l,(ix+8)         ; x coordinate.
2137   89FD DD 7E 09           ld a,(ix+9)         ; y coordinate.
2138   8A00 C6 10              add a,16            ; look right 16 pixels.
2139   8A02 67                 ld h,a              ; coords in hl.
2140   8A03             
2141   8A03 22 3A 7D    cangh  ld (dispx),hl       ; set up test coordinates.
2142   8A06 06 03       cangh2 ld b,3              ; default rows to write.
2143   8A08 7D                 ld a,l              ; x position.
2144   8A09 E6 07              and 7               ; does x straddle cells?
2145   8A0B 20 01              jr nz,cangh0        ; yes, loop counter is good.
2146   8A0D 05                 dec b               ; one less row to write.
2147   8A0E CD DC 8A    cangh0 call tstbl          ; get map address.
2148   8A11 11 20 00           ld de,32            ; distance to next cell.
2149   8A14 CD 1C 8A    cangh1 call lrchk          ; standard left/right check.
2150   8A17 C0                 ret nz              ; no way through.
2151   8A18 19                 add hl,de           ; look down.
2152   8A19 10 F9              djnz cangh1
2153   8A1B C9                 ret
2154   8A1C             
2155   8A1C             ; Check left/right movement is okay.
2156   8A1C             
2157   8A1C 7E          lrchk  ld a,(hl)           ; fetch map cell.
2158   8A1D FE 02              cp WALL             ; is it passable?
2159   8A1F 28 06              jr z,lrchkx         ; no.
2160   8A21 FE 04              cp FODDER           ; fodder has to be dug.
2161   8A23 28 02              jr z,lrchkx         ; not passable.
2162   8A25 AF          always xor a               ; report it as okay.
2163   8A26 C9                 ret
2164   8A27 AF          lrchkx xor a               ; reset all bits.
2165   8A28 3C                 inc a
2166   8A29 C9                 ret
2167   8A2A             
2168   8A2A             ; Check platform or solid item is not in way.
2169   8A2A             
2170   8A2A 7E          plchk  ld a,(hl)           ; fetch map cell.
2171   8A2B FE 02              cp WALL             ; is it passable?
2172   8A2D 28 F8              jr z,lrchkx         ; no.
2173   8A2F FE 04              cp FODDER           ; fodder has to be dug.
2174   8A31 28 F4              jr z,lrchkx         ; not passable.
2175   8A33 FE 01              cp PLATFM           ; platform is solid.
2176   8A35 28 06              jr z,plchkx         ; not passable.
2177   8A37 FE 03              cp LADDER           ; is it a ladder?
2178   8A39 28 EC              jr z,lrchkx         ; on ladder, deny movement.
2179   8A3B AF          plchk0 xor a               ; report it as okay.
2180   8A3C C9                 ret
2181   8A3D 3A 3A 7D    plchkx ld a,(dispx)        ; x coordinate.
2182   8A40 E6 07              and 7               ; position straddling blocks.
2183   8A42 28 E3              jr z,lrchkx         ; on platform, deny movement.
2184   8A44 18 F5              jr plchk0
2185   8A46             
2186   8A46             ; Check ladder is available.
2187   8A46             
2188   8A46 7E          ldchk  ld a,(hl)           ; fetch cell.
2189   8A47 FE 03              cp LADDER           ; is it a ladder?
2190   8A49 C9                 ret                 ; return with zero flag set accordingly.
2191   8A4A             
2192   8A4A             ; Get collectables.
2193   8A4A             
2194   8A4A 06 08       getcol ld b,COLECT         ; collectable blocks.
2195   8A4C CD 94 8A           call tded           ; test for collectable blocks.
2196   8A4F B8                 cp b                ; did we find one?
2197   8A50 C0                 ret nz              ; none were found, job done.
2198   8A51 CD 59 8A           call gtblk          ; get block.
2199   8A54 CD 4A 94           call evnt20         ; collected block event.
2200   8A57 18 F1              jr getcol           ; repeat until none left.
2201   8A59             
2202   8A59             ; Get collectable block.
2203   8A59             
2204   8A59 36 00       gtblk  ld (hl),0           ; make it empty now.
2205   8A5B 11 00 58           ld de,MAP           ; map address.
2206   8A5E A7                 and a               ; clear carry.
2207   8A5F ED 52              sbc hl,de           ; find cell number.
2208   8A61 7D                 ld a,l              ; get low byte of cell number.
2209   8A62 E6 1F              and 31              ; 0 - 31 is column.
2210   8A64 57                 ld d,a              ; store y in d register.
2211   8A65 29                 add hl,hl           ; multiply by 8.
2212   8A66 29                 add hl,hl
2213   8A67 29                 add hl,hl           ; x is now in h.
2214   8A68 5C                 ld e,h              ; put x in e.
2215   8A69 ED 53 3A 7D        ld (dispx),de       ; set display coordinates.
2216   8A6D             
2217   8A6D 3A 54 88           ld a,(colpat)       ; get collectable block used on this screen.
2218   8A70 07                 rlca                ; multiply char by 16.
2219   8A71 07                 rlca
2220   8A72 07                 rlca
2221   8A73 07                 rlca
2222   8A74 5F                 ld e,a              ; store shift in e.
2223   8A75 E6 0F              and 15              ; only want high byte bits.
2224   8A77 57                 ld d,a              ; store in d.
2225   8A78 7B                 ld a,e              ; restore shifted value.
2226   8A79 E6 F0              and 240             ; only want low byte bits.
2227   8A7B 5F                 ld e,a              ; that's the low byte.
2228   8A7C 21 4D 94           ld hl,chgfx         ; address of graphics.
2229   8A7F 19                 add hl,de           ; add displacement.
2230   8A80 CD 01 88           call gprad          ; get screen address.
2231   8A83             
2232   8A83 06 08              ld b,8              ; number of pixel rows to write.
2233   8A85 1A          gtblk0 ld a,(de)           ; get screen byte.
2234   8A86 AE                 xor (hl)            ; merge with block image.
2235   8A87 12                 ld (de),a           ; copy to screen.
2236   8A88 23                 inc hl              ; next image byte.
2237   8A89 CB EA              set 5,d             ; attribute screen.
2238   8A8B 7E                 ld a,(hl)           ; get image byte.
2239   8A8C 12                 ld (de),a           ; copy to screen.
2240   8A8D 23                 inc hl              ; next image byte.
2241   8A8E CB AA              res 5,d             ; pixel screen.
2242   8A90 14                 inc d               ; next screen row down.
2243   8A91 10 F2              djnz gtblk0         ; repeat for 8 pixel rows.
2244   8A93 C9                 ret
2245   8A94             
2246   8A94             ; Touched deadly block check.
2247   8A94             ; Returns with DEADLY (must be non-zero) in accumulator if true.
2248   8A94             
2249   8A94 DD 6E 08    tded   ld l,(ix+8)         ; x coordinate.
2250   8A97 DD 66 09           ld h,(ix+9)         ; y coordinate.
2251   8A9A 22 3A 7D           ld (dispx),hl       ; set up test coordinates.
2252   8A9D CD DC 8A           call tstbl          ; get map address.
2253   8AA0 11 1F 00           ld de,31            ; default distance to next line down.
2254   8AA3 B8                 cp b                ; is this the required block?
2255   8AA4 C8                 ret z               ; yes.
2256   8AA5 23                 inc hl              ; next cell.
2257   8AA6 7E                 ld a,(hl)           ; fetch type.
2258   8AA7 B8                 cp b                ; is this deadly/custom?
2259   8AA8 C8                 ret z               ; yes.
2260   8AA9 3A 3B 7D           ld a,(dispy)        ; horizontal position.
2261   8AAC 4F                 ld c,a              ; store column in c register.
2262   8AAD E6 07              and 7               ; is it straddling cells?
2263   8AAF 28 05              jr z,tded0          ; no.
2264   8AB1 23                 inc hl              ; last cell.
2265   8AB2 7E                 ld a,(hl)           ; fetch type.
2266   8AB3 B8                 cp b                ; is this the block?
2267   8AB4 C8                 ret z               ; yes.
2268   8AB5 1B                 dec de              ; one less cell to next row down.
2269   8AB6 19          tded0  add hl,de           ; point to next row.
2270   8AB7 7E                 ld a,(hl)           ; fetch left cell block.
2271   8AB8 B8                 cp b                ; is this fatal?
2272   8AB9 C8                 ret z               ; yes.
2273   8ABA 23                 inc hl              ; next cell.
2274   8ABB 7E                 ld a,(hl)           ; fetch type.
2275   8ABC B8                 cp b                ; is this fatal?
2276   8ABD C8                 ret z               ; yes.
2277   8ABE 79                 ld a,c              ; horizontal position.
2278   8ABF E6 07              and 7               ; is it straddling cells?
2279   8AC1 28 04              jr z,tded1          ; no.
2280   8AC3 23                 inc hl              ; last cell.
2281   8AC4 7E                 ld a,(hl)           ; fetch type.
2282   8AC5 B8                 cp b                ; is this fatal?
2283   8AC6 C8                 ret z               ; yes.
2284   8AC7 3A 3A 7D    tded1  ld a,(dispx)        ; vertical position.
2285   8ACA E6 07              and 7               ; is it straddling cells?
2286   8ACC C8                 ret z               ; no, job done.
2287   8ACD 19                 add hl,de           ; point to next row.
2288   8ACE 7E                 ld a,(hl)           ; fetch left cell block.
2289   8ACF B8                 cp b                ; is this fatal?
2290   8AD0 C8                 ret z               ; yes.
2291   8AD1 23                 inc hl              ; next cell.
2292   8AD2 7E                 ld a,(hl)           ; fetch type.
2293   8AD3 B8                 cp b                ; is this fatal?
2294   8AD4 C8                 ret z               ; yes.
2295   8AD5 79                 ld a,c              ; horizontal position.
2296   8AD6 E6 07              and 7               ; is it straddling cells?
2297   8AD8 C8                 ret z               ; no.
2298   8AD9 23                 inc hl              ; last cell.
2299   8ADA 7E                 ld a,(hl)           ; fetch final type.
2300   8ADB C9                 ret                 ; return with final type in accumulator.
2301   8ADC             
2302   8ADC             
2303   8ADC             ; Fetch block type at (dispx, dispy).
2304   8ADC             
2305   8ADC 3A 3A 7D    tstbl  ld a,(dispx)        ; fetch x coord.
2306   8ADF 07                 rlca                ; divide by 8,
2307   8AE0 07                 rlca                ; and multiply by 32.
2308   8AE1 57                 ld d,a              ; store in d.
2309   8AE2 E6 E0              and 224             ; mask off high bits.
2310   8AE4 5F                 ld e,a              ; low byte.
2311   8AE5 7A                 ld a,d              ; restore shift result.
2312   8AE6 E6 03              and 3               ; high bits.
2313   8AE8 57                 ld d,a              ; got displacement in de.
2314   8AE9 3A 3B 7D           ld a,(dispy)        ; y coord.
2315   8AEC 1F                 rra                 ; divide by 8.
2316   8AED 1F                 rra
2317   8AEE 1F                 rra
2318   8AEF E6 1F              and 31              ; only want 0 - 31.
2319   8AF1 83                 add a,e             ; add to displacement.
2320   8AF2 5F                 ld e,a              ; displacement in de.
2321   8AF3 21 00 58           ld hl,MAP           ; position of dummy screen.
2322   8AF6 19                 add hl,de           ; point to address.
2323   8AF7 7E                 ld a,(hl)           ; fetch byte there.
2324   8AF8 C9                 ret
2325   8AF9             
2326   8AF9             ; Jump - if we can.
2327   8AF9             ; Requires initial speed to be set up in accumulator prior to call.
2328   8AF9             
2329   8AF9 ED 44       jump   neg                 ; switch sign so we jump up.
2330   8AFB 4F                 ld c,a              ; store in c register.
2331   8AFC             ;       ld a,(ix+8)         ; x coordinate.
2332   8AFC             ;       ld h,(ix+9)         ; y coordinate.
2333   8AFC             ;numsp4 add a,16            ; look down 16 pixels.
2334   8AFC             ;       ld l,a              ; coords in hl.
2335   8AFC             ;       and 7               ; are we on platform boundary?
2336   8AFC             ;       ret nz              ; no, cannot jump.
2337   8AFC             ;       ld (dispx),hl       ; set up test coordinates.
2338   8AFC             ;       ld b,a              ; copy to b register.
2339   8AFC             ;       call tstbl          ; get map address.
2340   8AFC             ;       call plchk          ; block, platform check.
2341   8AFC             ;       jr nz,jump0         ; it's solid, we can jump.
2342   8AFC             ;       inc hl              ; look right one cell.
2343   8AFC             ;       call plchk          ; block, platform check.
2344   8AFC             ;       jr nz,jump0         ; it's solid, we can jump.
2345   8AFC             ;       ld a,b              ; y coordinate.
2346   8AFC             ;       and 7               ; position straddling block cells.
2347   8AFC             ;       ret z               ; no more checks needed.
2348   8AFC             ;       inc hl              ; look to third cell.
2349   8AFC             ;       call plchk          ; block, platform check.
2350   8AFC             ;       ret z               ; not solid, don't jump.
2351   8AFC DD 7E 0D    jump0  ld a,(ix+13)        ; jumping flag.
2352   8AFF A7                 and a               ; is it set?
2353   8B00 C0                 ret nz              ; already in the air.
2354   8B01 DD 34 0D           inc (ix+13)         ; set it.
2355   8B04 DD 71 0E           ld (ix+14),c        ; set jump height.
2356   8B07 C9                 ret
2357   8B08             
2358   8B08 DD 7E 0D    hop    ld a,(ix+13)        ; jumping flag.
2359   8B0B A7                 and a               ; is it set?
2360   8B0C C0                 ret nz              ; already in the air.
2361   8B0D DD 36 0D FF        ld (ix+13),255      ; set it.
2362   8B11 DD 36 0E 00        ld (ix+14),0        ; set jump table displacement.
2363   8B15 C9                 ret
2364   8B16             
2365   8B16             
2366   8B16             ; Random numbers code.
2367   8B16             ; Pseudo-random number generator, 8-bit.
2368   8B16             
2369   8B16 21 49 87    random ld hl,seed          ; set up seed pointer.
2370   8B19 7E                 ld a,(hl)           ; get last random number.
2371   8B1A 47                 ld b,a              ; copy to b register.
2372   8B1B 0F                 rrca                ; multiply by 32.
2373   8B1C 0F                 rrca
2374   8B1D 0F                 rrca
2375   8B1E EE 1F              xor 31
2376   8B20 80                 add a,b
2377   8B21 DE FF              sbc a,255
2378   8B23 77                 ld (hl),a           ; store new seed.
2379   8B24 32 32 7D           ld (varrnd),a       ; return number in variable.
2380   8B27 C9                 ret
2381   8B28             
2382   8B28             
2383   8B28             ; Keyboard test routine.
2384   8B28             
2385   8B28 4F          ktest  ld c,a              ; key to test in c.
2386   8B29 E6 07              and 7               ; mask bits d0-d2 for row.
2387   8B2B 3C                 inc a               ; in range 1-8.
2388   8B2C 47                 ld b,a              ; place in b.
2389   8B2D CB 39              srl c               ; divide c by 8
2390   8B2F CB 39              srl c               ; to find position within row.
2391   8B31 CB 39              srl c
2392   8B33 3E 05              ld a,5              ; only 5 keys per row.
2393   8B35 91                 sub c               ; subtract position.
2394   8B36 4F                 ld c,a              ; put in c.
2395   8B37 3E FE              ld a,254            ; high byte of port to read.
2396   8B39 0F          ktest0 rrca                ; rotate into position.
2397   8B3A 10 FD              djnz ktest0         ; repeat until we've found relevant row.
2398   8B3C DB FE              in a,(254)          ; read port (a=high, 254=low).
2399   8B3E 1F          ktest1 rra                 ; rotate bit out of result.
2400   8B3F 0D                 dec c               ; loop counter.
2401   8B40 C2 3E 8B           jp nz,ktest1        ; repeat until bit for position in carry.
2402   8B43 C9                 ret
2403   8B44             
2404   8B44             
2405   8B44             ; Joystick and keyboard reading routines.
2406   8B44             
2407   8B44 3A 2E 7D    joykey ld a,(contrl)       ; control flag.
2408   8B47 3D                 dec a               ; is it the keyboard?
2409   8B48 28 18              jr z,joyjoy         ; no, it's Kempston joystick.
2410   8B4A 3D                 dec a               ; Sinclair?
2411   8B4B 28 34              jr z,joysin         ; read Sinclair joystick.
2412   8B4D             
2413   8B4D             ; Keyboard controls.
2414   8B4D             
2415   8B4D 21 96 CC           ld hl,keys+6        ; address of last key.
2416   8B50 1E 00              ld e,0              ; zero reading.
2417   8B52 16 07              ld d,7              ; keys to read.
2418   8B54 7E          joyke0 ld a,(hl)           ; get key from table.
2419   8B55 CD 28 8B           call ktest          ; being pressed?
2420   8B58 3F                 ccf                 ; complement the carry.
2421   8B59 CB 13              rl e                ; rotate into reading.
2422   8B5B 2B                 dec hl              ; next key.
2423   8B5C 15                 dec d               ; one less to do.
2424   8B5D C2 54 8B           jp nz,joyke0        ; repeat for all keys.
2425   8B60 18 1A              jr joyjo1           ; store the value.
2426   8B62             
2427   8B62             ; Kempston joystick controls.
2428   8B62             
2429   8B62 01 1F 00    joyjoy ld bc,31            ; port for Kempston interface.
2430   8B65 ED 78              in a,(c)            ; read it.
2431   8B67 5F          joyjo3 ld e,a              ; copy to e register.
2432   8B68 3A 95 CC           ld a,(keys+5)       ; key six.
2433   8B6B CD 28 8B           call ktest          ; being pressed?
2434   8B6E 38 02              jr c,joyjo0         ; not pressed.
2435   8B70 CB EB              set 5,e             ; set bit d5.
2436   8B72 3A 96 CC    joyjo0 ld a,(keys+6)       ; key seven.
2437   8B75 CD 28 8B           call ktest          ; being pressed?
2438   8B78 38 02              jr c,joyjo1         ; not pressed.
2439   8B7A CB F3              set 6,e             ; set bit d6.
2440   8B7C 7B          joyjo1 ld a,e              ; copy e register to accumulator.
2441   8B7D 32 09 7D    joyjo2 ld (joyval),a       ; remember value.
2442   8B80 C9                 ret
2443   8B81             
2444   8B81             ; Sinclair joystick controls.
2445   8B81             
2446   8B81 01 FE EF    joysin ld bc,61438         ; port for Sinclair 2.
2447   8B84 ED 78              in a,(c)            ; read joystick.
2448   8B86 57                 ld d,a              ; clear values.
2449   8B87 AF                 xor a               ; clear accumulator.
2450   8B88 1E 10              ld e,16             ; Kempston fire bit value.
2451   8B8A CB 42              bit 0,d             ; fire bit pressed?
2452   8B8C CC AD 8B           call z,joysi0       ; add bit.
2453   8B8F 1E 01              ld e,1              ; Kempston bit value.
2454   8B91 CB 5A              bit 3,d             ; fire bit pressed?
2455   8B93 CC AD 8B           call z,joysi0       ; add bit.
2456   8B96 1E 02              ld e,2              ; Kempston bit value.
2457   8B98 CB 62              bit 4,d             ; fire bit pressed?
2458   8B9A CC AD 8B           call z,joysi0       ; add bit.
2459   8B9D 1E 08              ld e,8              ; Kempston bit value.
2460   8B9F CB 4A              bit 1,d             ; fire bit pressed?
2461   8BA1 CC AD 8B           call z,joysi0       ; add bit.
2462   8BA4 1E 04              ld e,4              ; Kempston bit value.
2463   8BA6 CB 52              bit 2,d             ; fire bit pressed?
2464   8BA8 CC AD 8B           call z,joysi0       ; add bit.
2465   8BAB 18 BA              jr joyjo3           ; read last 2 keys a la Kempston.
2466   8BAD             
2467   8BAD 83          joysi0 add a,e             ; add bit value.
2468   8BAE C9                 ret
2469   8BAF             
2470   8BAF             ; Display message.
2471   8BAF             
2472   8BAF             ;dmsg   ld hl,nummsg        ; total messages.
2473   8BAF             ;       cp (hl)             ; does this one exist?
2474   8BAF             ;       ret nc              ; no, nothing to display.
2475   8BAF 21 4C 94    dmsg   ld hl,msgdat        ; pointer to messages.
2476   8BB2 CD 90 8C           call getwrd         ; get message number.
2477   8BB5 CD 7F 8C    dmsg3  call preprt         ; pre-printing stuff.
2478   8BB8 CD 5E 87           call checkx         ; make sure we're in a printable range.
2479   8BBB 3A EE 8B           ld a,(prtmod)       ; print mode.
2480   8BBE A7                 and a               ; standard size?
2481   8BBF C2 EF 8B           jp nz,bmsg1         ; no, double-height text.
2482   8BC2 E5          dmsg0  push hl             ; store string pointer.
2483   8BC3 7E                 ld a,(hl)           ; fetch byte to display.
2484   8BC4 E6 7F              and 127             ; remove any end marker.
2485   8BC6 FE 0D              cp 13               ; newline character?
2486   8BC8 28 14              jr z,dmsg1
2487   8BCA CD 2F 88           call pchar          ; display character.
2488   8BCD             ;       call gaadd          ; get attribute address.
2489   8BCD             ;       ld a,(23693)        ; current cell colours.
2490   8BCD             ;       ld (hl),a           ; write to attribute cell.
2491   8BCD CD 6D 8C           call nexpos         ; display position.
2492   8BD0 20 03              jr nz,dmsg2         ; not on a new line.
2493   8BD2 CD 77 8C           call nexlin         ; next line down.
2494   8BD5 E1          dmsg2  pop hl
2495   8BD6 7E                 ld a,(hl)           ; fetch last character.
2496   8BD7 17                 rla                 ; was it the end?
2497   8BD8 DA 80 87           jp c,dscor2         ; yes, job done.
2498   8BDB 23                 inc hl              ; next character to display.
2499   8BDC 18 E4              jr dmsg0
2500   8BDE 21 3A 7D    dmsg1  ld hl,dispx         ; x coordinate.
2501   8BE1 34                 inc (hl)            ; newline.
2502   8BE2 7E                 ld a,(hl)           ; fetch position.
2503   8BE3 FE 18              cp 24               ; past screen edge?
2504   8BE5 38 02              jr c,dmsg4          ; no, it's okay.
2505   8BE7 36 00              ld (hl),0           ; restart at top.
2506   8BE9 23          dmsg4  inc hl              ; y coordinate.
2507   8BEA 36 00              ld (hl),0           ; carriage return.
2508   8BEC 18 E7              jr dmsg2
2509   8BEE 00          prtmod defb 0              ; print mode, 0 = standard, 1 = double-height.
2510   8BEF             
2511   8BEF             ; Display message in big text.
2512   8BEF             
2513   8BEF 7E          bmsg1  ld a,(hl)           ; get character to display.
2514   8BF0 E5                 push hl             ; store pointer to message.
2515   8BF1 E6 7F              and 127             ; only want 7 bits.
2516   8BF3 FE 0D              cp 13               ; newline character?
2517   8BF5 28 0A              jr z,bmsg2
2518   8BF7 CD 12 8C           call bchar          ; display big char.
2519   8BFA E1          bmsg3  pop hl              ; retrieve message pointer.
2520   8BFB 7E                 ld a,(hl)           ; look at last character.
2521   8BFC 23                 inc hl              ; next character in list.
2522   8BFD 17                 rla                 ; was terminator flag set?
2523   8BFE 30 EF              jr nc,bmsg1         ; no, keep going.
2524   8C00 C9                 ret
2525   8C01 21 2F 7D    bmsg2  ld hl,charx         ; x coordinate.
2526   8C04 34                 inc (hl)            ; newline.
2527   8C05 34                 inc (hl)            ; newline.
2528   8C06 7E                 ld a,(hl)           ; fetch position.
2529   8C07 FE 17              cp 23               ; past screen edge?
2530   8C09 38 EF              jr c,bmsg3          ; no, it's okay.
2531   8C0B 36 00              ld (hl),0           ; restart at top.
2532   8C0D 23                 inc hl              ; y coordinate.
2533   8C0E 36 00              ld (hl),0           ; carriage return.
2534   8C10 18 E8              jr bmsg3
2535   8C12             
2536   8C12             ; Big character display.
2537   8C12             
2538   8C12 07          bchar  rlca                ; multiply char by 8.
2539   8C13 07                 rlca
2540   8C14 07                 rlca
2541   8C15 5F                 ld e,a              ; store shift in e.
2542   8C16 E6 07              and 7               ; only want high byte bits.
2543   8C18 57                 ld d,a              ; store in d.
2544   8C19 7B                 ld a,e              ; restore shifted value.
2545   8C1A E6 F8              and 248             ; only want low byte bits.
2546   8C1C 5F                 ld e,a              ; that's the low byte.
2547   8C1D 2A 36 5C           ld hl,(23606)       ; address of font.
2548   8C20 19                 add hl,de           ; add displacement.
2549   8C21 CD 01 88           call gprad          ; get screen address.
2550   8C24 EB                 ex de,hl            ; font in de, screen address in hl.
2551   8C25 E5                 push hl             ; store screen address.
2552   8C26 06 08              ld b,8              ; height of character in font.
2553   8C28 1A          bchar0 ld a,(de)           ; get a bit of the font.
2554   8C29 13                 inc de              ; next line of font.
2555   8C2A 77                 ld (hl),a           ; write to screen.
2556   8C2B 24                 inc h               ; down a line.
2557   8C2C 77                 ld (hl),a           ; write to screen.
2558   8C2D CD A6 8E           call nline          ; next line down.
2559   8C30 10 F6              djnz bchar0         ; repeat.
2560   8C32 E1                 pop hl              ; restore screen address.
2561   8C33 CB EC              set 5,h             ; point to attributes.
2562   8C35 3A 8D 5C           ld a,(23693)        ; get attribute to write.
2563   8C38 4F                 ld c,a              ; copy to c register.
2564   8C39 06 10              ld b,16             ; lines to write.
2565   8C3B 71          bchar4 ld (hl),c           ; write colours to screen.
2566   8C3C CD BE 8E           call nattr          ; next attribute line down.
2567   8C3F 10 FA              djnz bchar4         ; repeat.
2568   8C41 CD 6D 8C    bchar1 call nexpos         ; display position.
2569   8C44 C2 4B 8C           jp nz,bchar2        ; not on a new line.
2570   8C47 34                 inc (hl)            ; newline.
2571   8C48 CD 77 8C           call nexlin         ; next line check.
2572   8C4B C3 80 87    bchar2 jp dscor2           ; tidy up line and column variables.
2573   8C4E 34          bchar3 inc (hl)            ; newline.
2574   8C4F CD 77 8C           call nexlin         ; next line check.
2575   8C52 C3 80 87           jp dscor2           ; tidy up line and column variables.
2576   8C55             
2577   8C55             ; Display a character.
2578   8C55             
2579   8C55 47          achar  ld b,a              ; copy to b.
2580   8C56 CD 7F 8C           call preprt         ; get ready to print.
2581   8C59 3A EE 8B           ld a,(prtmod)       ; print mode.
2582   8C5C A7                 and a               ; standard size?
2583   8C5D 78                 ld a,b              ; character in accumulator.
2584   8C5E C2 12 8C           jp nz,bchar         ; no, double-height text.
2585   8C61 CD 2F 88           call pchar          ; display character.
2586   8C64             ;       call gaadd          ; get attribute address.
2587   8C64             ;       ld a,(23693)        ; current cell colours.
2588   8C64             ;       ld (hl),a           ; write to attribute cell.
2589   8C64 CD 6D 8C           call nexpos         ; display position.
2590   8C67 CA 4E 8C           jp z,bchar3         ; next line down.
2591   8C6A C3 4B 8C           jp bchar2           ; tidy up.
2592   8C6D             
2593   8C6D             ; Get next print column position.
2594   8C6D             
2595   8C6D 21 3B 7D    nexpos ld hl,dispy         ; display position.
2596   8C70 7E                 ld a,(hl)           ; get coordinate.
2597   8C71 3C                 inc a               ; move along one position.
2598   8C72 E6 1F              and 31              ; reached edge of screen?
2599   8C74 77                 ld (hl),a           ; set new position.
2600   8C75 2B                 dec hl              ; point to x now.
2601   8C76 C9                 ret                 ; return with status in zero flag.
2602   8C77             
2603   8C77             ; Get next print line position.
2604   8C77             
2605   8C77 34          nexlin inc (hl)            ; newline.
2606   8C78 7E                 ld a,(hl)           ; vertical position.
2607   8C79 FE 18              cp 24               ; past screen edge?
2608   8C7B D8                 ret c               ; no, still okay.
2609   8C7C 36 00              ld (hl),0           ; restart at top.
2610   8C7E C9                 ret
2611   8C7F             
2612   8C7F             ; Pre-print preliminaries.
2613   8C7F             
2614   8C7F ED 5B 36 5C preprt ld de,(23606)       ; font pointer.
2615   8C83 ED 53 5C 87        ld (grbase),de      ; set up graphics base.
2616   8C87 ED 5B 2F 7D prescr ld de,(charx)       ; display coordinates.
2617   8C8B ED 53 3A 7D        ld (dispx),de       ; set up general coordinates.
2618   8C8F C9                 ret
2619   8C90             
2620   8C90             ; On entry: hl points to word list
2621   8C90             ;           a contains word number.
2622   8C90             
2623   8C90 A7          getwrd and a               ; first word in list?
2624   8C91 C8                 ret z               ; yep, don't search.
2625   8C92 47                 ld b,a
2626   8C93 7E          getwd0 ld a,(hl)
2627   8C94 23                 inc hl
2628   8C95 FE 80              cp 128              ; found end?
2629   8C97 38 FA              jr c,getwd0         ; no, carry on.
2630   8C99 10 F8              djnz getwd0         ; until we have right number.
2631   8C9B C9                 ret
2632   8C9C             
2633   8C9C             
2634   8C9C             ; Bubble sort.
2635   8C9C             
2636   8C9C 06 0B       bsort  ld b,NUMSPR - 1     ; sprites to swap.
2637   8C9E DD 21 6C 92        ld ix,sprtab        ; sprite table.
2638   8CA2 C5          bsort0 push bc             ; store loop counter for now.
2639   8CA3             
2640   8CA3 DD 7E 00           ld a,(ix+0)         ; first sprite type.
2641   8CA6 3C                 inc a               ; is it switched off?
2642   8CA7 28 22              jr z,swemp          ; yes, may need to switch another in here.
2643   8CA9             
2644   8CA9 DD 7E 11           ld a,(ix+TABSIZ)    ; check next slot exists.
2645   8CAC 3C                 inc a               ; is it enabled?
2646   8CAD 28 08              jr z,bsort2         ; no, nothing to swap.
2647   8CAF             
2648   8CAF DD 7E 14           ld a,(ix+(3+TABSIZ)); fetch next sprite's coordinate.
2649   8CB2 DD BE 03           cp (ix+3)           ; compare with this x coordinate.
2650   8CB5 38 09              jr c,bsort1         ; next sprite is higher - may need to switch.
2651   8CB7 11 11 00    bsort2 ld de,TABSIZ        ; distance to next odd/even entry.
2652   8CBA DD 19              add ix,de           ; next sprite.
2653   8CBC C1                 pop bc              ; retrieve loop counter.
2654   8CBD 10 E3              djnz bsort0         ; repeat for remaining sprites.
2655   8CBF C9                 ret
2656   8CC0             
2657   8CC0 DD 7E 11    bsort1 ld a,(ix+TABSIZ)    ; sprite on/off flag.
2658   8CC3 3C                 inc a               ; is it enabled?
2659   8CC4 28 F1              jr z,bsort2         ; no, nothing to swap.
2660   8CC6 CD D6 8C           call swspr          ; swap positions.
2661   8CC9 18 EC              jr bsort2
2662   8CCB             
2663   8CCB DD 7E 11    swemp  ld a,(ix+TABSIZ)    ; next table entry.
2664   8CCE 3C                 inc a               ; is that one on?
2665   8CCF 28 E6              jr z,bsort2         ; no, nothing to swap.
2666   8CD1 CD D6 8C           call swspr          ; swap positions.
2667   8CD4 18 E1              jr bsort2
2668   8CD6             
2669   8CD6             ; Swap sprites.
2670   8CD6             
2671   8CD6 DD E5       swspr  push ix             ; table address on stack.
2672   8CD8 E1                 pop hl              ; pop into hl pair.
2673   8CD9 54                 ld d,h              ; copy to de pair.
2674   8CDA 5D                 ld e,l
2675   8CDB 01 11 00           ld bc,TABSIZ        ; distance to second entry.
2676   8CDE 09                 add hl,bc           ; point to second sprite entry.
2677   8CDF 06 11              ld b,TABSIZ         ; bytes to swap.
2678   8CE1 4E          swspr0 ld c,(hl)           ; fetch second byte.
2679   8CE2 1A                 ld a,(de)           ; fetch first byte.
2680   8CE3 77                 ld (hl),a           ; copy to second.
2681   8CE4 79                 ld a,c              ; second byte in accumulator.
2682   8CE5 12                 ld (de),a           ; copy to first sprite entry.
2683   8CE6 13                 inc de              ; next byte.
2684   8CE7 23                 inc hl              ; next byte.
2685   8CE8 10 F7              djnz swspr0         ; swap all bytes in table entry.
2686   8CEA C9                 ret
2687   8CEB             
2688   8CEB             
2689   8CEB             ; Process sprites.
2690   8CEB             
2691   8CEB 06 0C       pspr   ld b,NUMSPR         ; sprites to process.
2692   8CED DD 21 6C 92        ld ix,sprtab        ; sprite table.
2693   8CF1 C5          pspr1  push bc             ; store loop counter for now.
2694   8CF2 DD 7E 00           ld a,(ix+0)         ; fetch sprite type.
2695   8CF5 FE 09              cp 9                ; within range of sprite types?
2696   8CF7 DC 03 8D           call c,pspr2        ; yes, process this one.
2697   8CFA 11 11 00           ld de,TABSIZ        ; distance to next odd/even entry.
2698   8CFD DD 19              add ix,de           ; next sprite.
2699   8CFF C1                 pop bc              ; retrieve loop counter.
2700   8D00 10 EF              djnz pspr1          ; repeat for remaining sprites.
2701   8D02 C9                 ret
2702   8D03 DD 22 1C 8D pspr2  ld (ogptr),ix       ; store original sprite pointer.
2703   8D07 CD 0F 8D           call pspr3          ; do the routine.
2704   8D0A DD 2A 1C 8D rtorg  ld ix,(ogptr)       ; restore original pointer to sprite.
2705   8D0E C9          rtorg0 ret
2706   8D0F 21 1E 8D    pspr3  ld hl,evtyp0        ; sprite type events list.
2707   8D12 87          pspr4  add a,a             ; double accumulator.
2708   8D13 5F                 ld e,a              ; copy to de.
2709   8D14 16 00              ld d,0              ; no high byte.
2710   8D16 19                 add hl,de           ; point to address of routine.
2711   8D17 5E                 ld e,(hl)           ; address low.
2712   8D18 23                 inc hl              ; next byte of address.
2713   8D19 56                 ld d,(hl)           ; address high.
2714   8D1A EB                 ex de,hl            ; swap address into hl.
2715   8D1B E9                 jp (hl)             ; go there.
2716   8D1C 00 00       ogptr  defw 0              ; original sprite pointer.
2717   8D1E             
2718   8D1E             ; Address of each sprite type's routine.
2719   8D1E             
2720   8D1E 36 94       evtyp0 defw evnt00
2721   8D20 37 94       evtyp1 defw evnt01
2722   8D22 38 94       evtyp2 defw evnt02
2723   8D24 39 94       evtyp3 defw evnt03
2724   8D26 3A 94       evtyp4 defw evnt04
2725   8D28 3B 94       evtyp5 defw evnt05
2726   8D2A 3C 94       evtyp6 defw evnt06
2727   8D2C 3D 94       evtyp7 defw evnt07
2728   8D2E 3E 94       evtyp8 defw evnt08
2729   8D30             
2730   8D30             
2731   8D30             ; Display sprites.
2732   8D30             
2733   8D30 06 06       dspr   ld b,NUMSPR/2       ; number of sprites to display.
2734   8D32 C5          dspr0  push bc             ; store loop counter for now.
2735   8D33 DD 7E 00           ld a,(ix+0)         ; get sprite type.
2736   8D36 3C                 inc a               ; is it enabled?
2737   8D37 20 21              jr nz,dspr1         ; yes, it needs deleting.
2738   8D39 DD 7E 05    dspr5  ld a,(ix+5)         ; new type.
2739   8D3C 3C                 inc a               ; is it enabled?
2740   8D3D 20 4E              jr nz,dspr3         ; yes, it needs drawing.
2741   8D3F             
2742   8D3F DD E5       dspr2  push ix             ; put ix on stack.
2743   8D41 E1                 pop hl              ; pop into hl.
2744   8D42 5D                 ld e,l              ; copy to de.
2745   8D43 54                 ld d,h
2746   8D44             
2747   8D44             ;dspr2  ld e,ixl            ; copy ix to de.
2748   8D44             ;       ld d,ixh
2749   8D44             ;       ld l,e              ; copy to hl.
2750   8D44             ;       ld h,d
2751   8D44 01 05 00           ld bc,5             ; distance to new type.
2752   8D47 09                 add hl,bc           ; point to new properties.
2753   8D48 ED A0              ldi                 ; copy to old positions.
2754   8D4A ED A0              ldi
2755   8D4C ED A0              ldi
2756   8D4E ED A0              ldi
2757   8D50 ED A0              ldi
2758   8D52 0E 22              ld c,TABSIZ*2       ; distance to next odd/even entry.
2759   8D54 DD 09              add ix,bc           ; next sprite.
2760   8D56 C1                 pop bc              ; retrieve loop counter.
2761   8D57 10 D9              djnz dspr0          ; repeat for remaining sprites.
2762   8D59 C9                 ret
2763   8D5A             ;dspr1  ld a,(ix+3)         ; old x coord.
2764   8D5A             ;       cp 177              ; beyond maximum?
2765   8D5A             ;       jr nc,dspr5         ; yes, don't delete it.
2766   8D5A DD 7E 05    dspr1  ld a,(ix+5)         ; type of new sprite.
2767   8D5D 3C                 inc a               ; is this enabled?
2768   8D5E 20 06              jr nz,dspr4         ; yes, display both.
2769   8D60 CD FD 8D    dspr6  call sspria         ; show single sprite.
2770   8D63 C3 3F 8D           jp dspr2
2771   8D66             
2772   8D66             ; Displaying two sprites.  Don't bother redrawing if nothing has changed.
2773   8D66             
2774   8D66 DD 7E 04    dspr4  ld a,(ix+4)         ; old y.
2775   8D69 DD BE 09           cp (ix+9)           ; compare with new value.
2776   8D6C 20 19              jr nz,dspr7         ; they differ, need to redraw.
2777   8D6E DD 7E 03           ld a,(ix+3)         ; old x.
2778   8D71 DD BE 08           cp (ix+8)           ; compare against new value.
2779   8D74 20 11              jr nz,dspr7         ; they differ, need to redraw.
2780   8D76 DD 7E 02           ld a,(ix+2)         ; old frame.
2781   8D79 DD BE 07           cp (ix+7)           ; compare against new value.
2782   8D7C 20 09              jr nz,dspr7         ; they differ, need to redraw.
2783   8D7E DD 7E 01           ld a,(ix+1)         ; old image.
2784   8D81 DD BE 06           cp (ix+6)           ; compare against new value.
2785   8D84 CA 3F 8D           jp z,dspr2          ; everything is the same, don't redraw.
2786   8D87 CD 12 8E    dspr7  call sspric         ; delete old sprite, draw new one simultaneously.
2787   8D8A C3 3F 8D           jp dspr2
2788   8D8D CD 0C 8E    dspr3  call ssprib         ; show single sprite.
2789   8D90 C3 3F 8D           jp dspr2
2790   8D93             
2791   8D93             
2792   8D93             ; Get sprite address calculations.
2793   8D93             ; gspran = new sprite, gsprad = old sprite.
2794   8D93             
2795   8D93 DD 6E 08    gspran ld l,(ix+8)         ; new x coordinate.
2796   8D96 DD 66 09           ld h,(ix+9)         ; new y coordinate.
2797   8D99 22 3A 7D           ld (dispx),hl       ; set display coordinates.
2798   8D9C DD 7E 06           ld a,(ix+6)         ; new sprite image.
2799   8D9F CD BE 90           call gfrm           ; fetch start frame for this sprite.
2800   8DA2 7E                 ld a,(hl)           ; frame in accumulator.
2801   8DA3 DD 86 07           add a,(ix+7)        ; new add frame number.
2802   8DA6 C3 BC 8D           jp gspra0
2803   8DA9             
2804   8DA9 DD 6E 03    gsprad ld l,(ix+3)         ; x coordinate.
2805   8DAC DD 66 04           ld h,(ix+4)         ; y coordinate.
2806   8DAF 22 3A 7D           ld (dispx),hl       ; set display coordinates.
2807   8DB2 DD 7E 01           ld a,(ix+1)         ; sprite image.
2808   8DB5 CD BE 90           call gfrm           ; fetch start frame for this sprite.
2809   8DB8 7E                 ld a,(hl)           ; frame in accumulator.
2810   8DB9 DD 86 02           add a,(ix+2)        ; add frame number.
2811   8DBC             
2812   8DBC 0F          gspra0 rrca                ; multiply by 128.
2813   8DBD 57                 ld d,a              ; store in d.
2814   8DBE E6 80              and 128             ; low byte bit.
2815   8DC0 5F                 ld e,a              ; got low byte.
2816   8DC1 7A                 ld a,d              ; restore result.
2817   8DC2 E6 7F              and 127             ; high byte bits.
2818   8DC4 57                 ld d,a              ; displacement high byte.
2819   8DC5 21 F5 96           ld hl,sprgfx        ; address of play sprites.
2820   8DC8 19                 add hl,de           ; point to frame.
2821   8DC9             
2822   8DC9 3A 3B 7D           ld a,(dispy)        ; y coordinate.
2823   8DCC E6 06              and 6               ; position within byte boundary.
2824   8DCE 4F                 ld c,a              ; low byte of table displacement.
2825   8DCF 07                 rlca                ; multiply by 32.
2826   8DD0 07                 rlca                ; already a multiple
2827   8DD1 07                 rlca                ; of 2, so just 4
2828   8DD2 07                 rlca                ; shifts needed.
2829   8DD3 5F                 ld e,a              ; put displacement in low byte of de.
2830   8DD4 16 00              ld d,0              ; zero the high byte.
2831   8DD6 42                 ld b,d              ; no high byte for mask displacement either.
2832   8DD7 19                 add hl,de           ; add to sprite address.
2833   8DD8 EB                 ex de,hl            ; need it in de for now.
2834   8DD9 21 F5 8D           ld hl,spmask        ; pointer to mask table.
2835   8DDC 09                 add hl,bc           ; add displacement to pointer.
2836   8DDD 4E                 ld c,(hl)           ; left mask.
2837   8DDE 23                 inc hl
2838   8DDF 46                 ld b,(hl)           ; right mask.
2839   8DE0             
2840   8DE0             ; Drop into screen address routine.
2841   8DE0             ; This routine returns a screen address for (dispx, dispy) in hl.
2842   8DE0             
2843   8DE0 3A 3A 7D    scadd  ld a,(dispx)        ; coordinate.
2844   8DE3 6F                 ld l,a              ; low byte of table.
2845   8DE4 26 FB              ld h,251            ; high byte of 64256 (SCADTB).
2846   8DE6 7E                 ld a,(hl)           ; fetch high byte.
2847   8DE7 24                 inc h               ; point to low byte table.
2848   8DE8 6E                 ld l,(hl)           ; fetch low byte.
2849   8DE9 67                 ld h,a              ; hl points to start of line.
2850   8DEA 3A 3B 7D           ld a,(dispy)        ; y pixel coordinate.
2851   8DED 0F                 rrca                ; divide by 8.
2852   8DEE 0F                 rrca
2853   8DEF 0F                 rrca
2854   8DF0 E6 1F              and 31              ; squares 0 - 31 across screen.
2855   8DF2 85                 add a,l             ; add to address.
2856   8DF3 6F                 ld l,a              ; copy to hl = address of screen.
2857   8DF4 C9                 ret
2858   8DF5             
2859   8DF5             spmask defb 255,0,63,192,15,240,3,252
2859   8DF5 FF003FC00FF003FC
2860   8DFD             
2861   8DFD             
2862   8DFD             ; These are the sprite routines.
2863   8DFD             ; sspria = single sprite, old (ix).
2864   8DFD             ; ssprib = single sprite, new (ix+5).
2865   8DFD             ; sspric = both sprites, old (ix) and new (ix+5).
2866   8DFD             
2867   8DFD CD A9 8D    sspria call gsprad         ; get old sprite address.
2868   8E00 3E 10       sspri2 ld a,16             ; vertical lines.
2869   8E02 08          sspri0 ex af,af'           ; store line counter away in alternate registers.
2870   8E03 CD 95 8E           call dline          ; draw a line.
2871   8E06 08                 ex af,af'           ; restore line counter.
2872   8E07 3D                 dec a               ; one less to go.
2873   8E08 C2 02 8E           jp nz,sspri0
2874   8E0B C9                 ret
2875   8E0C             
2876   8E0C CD 93 8D    ssprib call gspran         ; get new sprite address.
2877   8E0F C3 00 8E           jp sspri2
2878   8E12             
2879   8E12 CD A9 8D    sspric call gsprad         ; get old sprite address.
2880   8E15 D9                 exx                 ; store addresses.
2881   8E16 CD 93 8D           call gspran         ; get new sprite addresses.
2882   8E19 CD 95 8E           call dline          ; draw a line.
2883   8E1C D9                 exx                 ; restore old addresses.
2884   8E1D CD 95 8E           call dline          ; delete a line.
2885   8E20 D9                 exx                 ; flip to new sprite addresses.
2886   8E21 CD 95 8E           call dline          ; draw a line.
2887   8E24 D9                 exx                 ; restore old addresses.
2888   8E25 CD 95 8E           call dline          ; delete a line.
2889   8E28 D9                 exx                 ; flip to new sprite addresses.
2890   8E29 CD 95 8E           call dline          ; draw a line.
2891   8E2C D9                 exx                 ; restore old addresses.
2892   8E2D CD 95 8E           call dline          ; delete a line.
2893   8E30 D9                 exx                 ; flip to new sprite addresses.
2894   8E31 CD 95 8E           call dline          ; draw a line.
2895   8E34 D9                 exx                 ; restore old addresses.
2896   8E35 CD 95 8E           call dline          ; delete a line.
2897   8E38 D9                 exx                 ; flip to new sprite addresses.
2898   8E39 CD 95 8E           call dline          ; draw a line.
2899   8E3C D9                 exx                 ; restore old addresses.
2900   8E3D CD 95 8E           call dline          ; delete a line.
2901   8E40 D9                 exx                 ; flip to new sprite addresses.
2902   8E41 CD 95 8E           call dline          ; draw a line.
2903   8E44 D9                 exx                 ; restore old addresses.
2904   8E45 CD 95 8E           call dline          ; delete a line.
2905   8E48 D9                 exx                 ; flip to new sprite addresses.
2906   8E49 CD 95 8E           call dline          ; draw a line.
2907   8E4C D9                 exx                 ; restore old addresses.
2908   8E4D CD 95 8E           call dline          ; delete a line.
2909   8E50 D9                 exx                 ; flip to new sprite addresses.
2910   8E51 CD 95 8E           call dline          ; draw a line.
2911   8E54 D9                 exx                 ; restore old addresses.
2912   8E55 CD 95 8E           call dline          ; delete a line.
2913   8E58 D9                 exx                 ; flip to new sprite addresses.
2914   8E59 CD 95 8E           call dline          ; draw a line.
2915   8E5C D9                 exx                 ; restore old addresses.
2916   8E5D CD 95 8E           call dline          ; delete a line.
2917   8E60 D9                 exx                 ; flip to new sprite addresses.
2918   8E61 CD 95 8E           call dline          ; draw a line.
2919   8E64 D9                 exx                 ; restore old addresses.
2920   8E65 CD 95 8E           call dline          ; delete a line.
2921   8E68 D9                 exx                 ; flip to new sprite addresses.
2922   8E69 CD 95 8E           call dline          ; draw a line.
2923   8E6C D9                 exx                 ; restore old addresses.
2924   8E6D CD 95 8E           call dline          ; delete a line.
2925   8E70 D9                 exx                 ; flip to new sprite addresses.
2926   8E71 CD 95 8E           call dline          ; draw a line.
2927   8E74 D9                 exx                 ; restore old addresses.
2928   8E75 CD 95 8E           call dline          ; delete a line.
2929   8E78 D9                 exx                 ; flip to new sprite addresses.
2930   8E79 CD 95 8E           call dline          ; draw a line.
2931   8E7C D9                 exx                 ; restore old addresses.
2932   8E7D CD 95 8E           call dline          ; delete a line.
2933   8E80 D9                 exx                 ; flip to new sprite addresses.
2934   8E81 CD 95 8E           call dline          ; draw a line.
2935   8E84 D9                 exx                 ; restore old addresses.
2936   8E85 CD 95 8E           call dline          ; delete a line.
2937   8E88 D9                 exx                 ; flip to new sprite addresses.
2938   8E89 CD 95 8E           call dline          ; draw a line.
2939   8E8C D9                 exx                 ; restore old addresses.
2940   8E8D CD 95 8E           call dline          ; delete a line.
2941   8E90 D9                 exx                 ; flip to new sprite addresses.
2942   8E91 CD 95 8E           call dline          ; draw a line.
2943   8E94 D9                 exx                 ; restore old addresses.
2944   8E95             
2945   8E95             ; Drop through.
2946   8E95             ; Line drawn, now work out next target address.
2947   8E95             
2948   8E95 1A          dline  ld a,(de)           ; graphic data.
2949   8E96 A1                 and c               ; mask away what's not needed.
2950   8E97 AE                 xor (hl)            ; XOR with what's there.
2951   8E98 77                 ld (hl),a           ; bung it in.
2952   8E99 2C                 inc l               ; next screen address.
2953   8E9A 2C                 inc l               ; next screen address.
2954   8E9B 1A                 ld a,(de)           ; fetch data.
2955   8E9C A0                 and b               ; mask away unwanted bits.
2956   8E9D AE                 xor (hl)            ; XOR with what's there.
2957   8E9E 77                 ld (hl),a           ; bung it in.
2958   8E9F 13                 inc de              ; next graphic.
2959   8EA0 2D                 dec l               ; one character cell to the left.
2960   8EA1 1A                 ld a,(de)           ; second bit of data.
2961   8EA2 AE                 xor (hl)            ; XOR with what's there.
2962   8EA3 77                 ld (hl),a           ; bung it in.
2963   8EA4 13                 inc de              ; point to next line of data.
2964   8EA5 2D                 dec l               ; another char left.
2965   8EA6             
2966   8EA6             ; Line drawn, now work out next target address.
2967   8EA6             
2968   8EA6 24          nline  inc h               ; increment pixel.
2969   8EA7 7C                 ld a,h              ; get pixel address.
2970   8EA8 E6 07              and 7               ; straddling character position?
2971   8EAA C0                 ret nz              ; no, we're on next line already.
2972   8EAB 7C                 ld a,h              ; get pixel address.
2973   8EAC D6 08              sub 8               ; subtract 8 for start of segment.
2974   8EAE 67                 ld h,a              ; new high byte of address.
2975   8EAF 7D                 ld a,l              ; get low byte of address.
2976   8EB0 C6 20              add a,32            ; one line down.
2977   8EB2 6F                 ld l,a              ; new low byte.
2978   8EB3 D0                 ret nc              ; not reached next segment yet.
2979   8EB4 7C                 ld a,h              ; address high.
2980   8EB5 C6 08              add a,8             ; add 8 to next segment.
2981   8EB7 67                 ld h,a              ; new high byte.
2982   8EB8 FE 58              cp 88               ; reached end of screen?
2983   8EBA D8                 ret c               ; not yet.
2984   8EBB 26 00              ld h,0              ; back to ROM.
2985   8EBD C9                 ret
2986   8EBE             
2987   8EBE             ; Attributes filled, now work out next attribute address.
2988   8EBE             
2989   8EBE 24          nattr  inc h               ; increment pixel.
2990   8EBF 7C                 ld a,h              ; get pixel address.
2991   8EC0 E6 07              and 7               ; straddling character position?
2992   8EC2 C0                 ret nz              ; no, we're on next line already.
2993   8EC3 7C                 ld a,h              ; get pixel address.
2994   8EC4 D6 08              sub 8               ; subtract 8 for start of segment.
2995   8EC6 67                 ld h,a              ; new high byte of address.
2996   8EC7 7D                 ld a,l              ; get low byte of address.
2997   8EC8 C6 20              add a,32            ; one line down.
2998   8ECA 6F                 ld l,a              ; new low byte.
2999   8ECB D0                 ret nc              ; not reached next segment yet.
3000   8ECC 7C                 ld a,h              ; address high.
3001   8ECD C6 08              add a,8             ; add 8 to next segment.
3002   8ECF 67                 ld h,a              ; new high byte.
3003   8ED0 FE 78              cp 120              ; reached end of screen?
3004   8ED2 D8                 ret c               ; not yet.
3005   8ED3 26 00              ld h,0              ; back to ROM.
3006   8ED5 C9                 ret
3007   8ED6             
3008   8ED6             
3009   8ED6             ; Animates a sprite.
3010   8ED6             
3011   8ED6 21 0A 7D    animsp ld hl,frmno         ; game frame.
3012   8ED9 A6                 and (hl)            ; is it time to change the frame?
3013   8EDA C0                 ret nz              ; not this frame.
3014   8EDB DD 7E 06           ld a,(ix+6)         ; sprite image.
3015   8EDE CD BE 90           call gfrm           ; get frame data.
3016   8EE1 23                 inc hl              ; point to frames.
3017   8EE2 DD 7E 07           ld a,(ix+7)         ; sprite frame.
3018   8EE5 3C                 inc a               ; next one along.
3019   8EE6 BE                 cp (hl)             ; reached the last frame?
3020   8EE7 38 01              jr c,anims0         ; no, not yet.
3021   8EE9 AF                 xor a               ; start at first frame.
3022   8EEA DD 77 07    anims0 ld (ix+7),a         ; new frame.
3023   8EED C9                 ret
3024   8EEE 21 0A 7D    animbk ld hl,frmno         ; game frame.
3025   8EF1 A6                 and (hl)            ; is it time to change the frame?
3026   8EF2 C0                 ret nz              ; not this frame.
3027   8EF3 DD 7E 06           ld a,(ix+6)         ; sprite image.
3028   8EF6 CD BE 90           call gfrm           ; get frame data.
3029   8EF9 23                 inc hl              ; point to frames.
3030   8EFA DD 7E 07           ld a,(ix+7)         ; sprite frame.
3031   8EFD A7                 and a               ; first one?
3032   8EFE 20 01              jr nz,rtanb0        ; yes, start at end.
3033   8F00 7E                 ld a,(hl)           ; last sprite.
3034   8F01 3D          rtanb0 dec a               ; next one along.
3035   8F02 18 E6              jr anims0           ; set new frame.
3036   8F04             
3037   8F04             ; Check for collision with other sprite, strict enforcement.
3038   8F04             
3039   8F04 21 6C 92    sktyp  ld hl,sprtab        ; sprite table.
3040   8F07 3E 0C       numsp2 ld a,NUMSPR         ; number of sprites.
3041   8F09 08          sktyp0 ex af,af'           ; store loop counter.
3042   8F0A 22 25 8F           ld (skptr),hl       ; store pointer to sprite.
3043   8F0D 7E                 ld a,(hl)           ; get sprite type.
3044   8F0E B8                 cp b                ; is it the type we seek?
3045   8F0F 28 16              jr z,coltyp         ; yes, we can use this one.
3046   8F11 2A 25 8F    sktyp1 ld hl,(skptr)       ; retrieve sprite pointer.
3047   8F14 11 11 00           ld de,TABSIZ        ; size of each entry.
3048   8F17 19                 add hl,de           ; point to next sprite in table.
3049   8F18 08                 ex af,af'           ; restore loop counter.
3050   8F19 3D                 dec a               ; one less iteration.
3051   8F1A C2 09 8F           jp nz,sktyp0        ; keep going until we find a slot.
3052   8F1D 21 00 00           ld hl,0             ; default to ROM address - no sprite.
3053   8F20 22 25 8F           ld (skptr),hl       ; store pointer to sprite.
3054   8F23 B4                 or h                ; don't return with zero flag set.
3055   8F24 C9                 ret                 ; didn't find one.
3056   8F25 00 00       skptr  defw 0              ; search pointer.
3057   8F27             
3058   8F27 DD 7E 00    coltyp ld a,(ix+0)         ; current sprite type.
3059   8F2A B8                 cp b                ; seeking sprite of same type?
3060   8F2B 28 27              jr z,colty1         ; yes, need to check we're not detecting ourselves.
3061   8F2D 11 08 00    colty0 ld de,X             ; distance to x position in table.
3062   8F30 19                 add hl,de           ; point to coords.
3063   8F31 5E                 ld e,(hl)           ; fetch x coordinate.
3064   8F32 23                 inc hl              ; now point to y.
3065   8F33 56                 ld d,(hl)           ; that's y coordinate.
3066   8F34             
3067   8F34             ; Drop into collision detection.
3068   8F34             
3069   8F34 DD 7E 08    colc16 ld a,(ix+X)         ; x coord.
3070   8F37 93                 sub e               ; subtract x.
3071   8F38 30 02              jr nc,colc1a        ; result is positive.
3072   8F3A ED 44              neg                 ; make negative positive.
3073   8F3C FE 10       colc1a cp 16               ; within x range?
3074   8F3E 30 D1              jr nc,sktyp1        ; no - they've missed.
3075   8F40 4F                 ld c,a              ; store difference.
3076   8F41 DD 7E 09           ld a,(ix+Y)         ; y coord.
3077   8F44 92                 sub d               ; subtract y.
3078   8F45 30 02              jr nc,colc1b        ; result is positive.
3079   8F47 ED 44              neg                 ; make negative positive.
3080   8F49 FE 10       colc1b cp 16               ; within y range?
3081   8F4B 30 C4              jr nc,sktyp1        ; no - they've missed.
3082   8F4D 81                 add a,c             ; add x difference.
3083   8F4E FE 1A              cp 26               ; only 5 corner pixels touching?
3084   8F50 D8                 ret c               ; carry set if there's a collision.
3085   8F51 C3 11 8F           jp sktyp1           ; try next sprite in table.
3086   8F54             
3087   8F54 DD E5       colty1 push ix             ; base sprite address onto stack.
3088   8F56 D1                 pop de              ; pop it into de.
3089   8F57 EB                 ex de,hl            ; flip hl into de.
3090   8F58 ED 52              sbc hl,de           ; compare the two.
3091   8F5A EB                 ex de,hl            ; restore hl.
3092   8F5B 28 B4              jr z,sktyp1         ; addresses are identical.
3093   8F5D C3 2D 8F           jp colty0
3094   8F60             
3095   8F60             ; Display number.
3096   8F60             
3097   8F60 01 71 8F    disply ld bc,displ0        ; display workspace.
3098   8F63 CD 65 84           call num2ch         ; convert accumulator to string.
3099   8F66 0B          displ1 dec bc              ; back one character.
3100   8F67 0A                 ld a,(bc)           ; fetch digit.
3101   8F68 F6 80              or 128              ; insert end marker.
3102   8F6A 02                 ld (bc),a           ; new value.
3103   8F6B 21 71 8F           ld hl,displ0        ; display space.
3104   8F6E C3 B5 8B           jp dmsg3            ; display the string.
3105   8F71 00 00 00 8D displ0 defb 0,0,0,13+128
3106   8F75             
3107   8F75             
3108   8F75             ; Initialise screen.
3109   8F75             
3110   8F75 3A 49 93    initsc ld a,(roomtb)       ; whereabouts in the map are we?
3111   8F78 CD 82 8F           call tstsc          ; find displacement.
3112   8F7B FE FF              cp 255              ; is it valid?
3113   8F7D C8                 ret z               ; no, it's rubbish.
3114   8F7E 32 14 7D           ld (scno),a         ; store new room number.
3115   8F81 C9                 ret
3116   8F82             
3117   8F82             ; Test screen.
3118   8F82             
3119   8F82 21 C7 93    tstsc  ld hl,mapdat-MAPWID ; start of map data, subtract width for negative.
3120   8F85 47                 ld b,a              ; store room in b for now.
3121   8F86 C6 0B              add a,MAPWID        ; add width in case we're negative.
3122   8F88 5F                 ld e,a              ; screen into e.
3123   8F89 16 00              ld d,0              ; zeroise d.
3124   8F8B 19                 add hl,de           ; add displacement to map data.
3125   8F8C 7E                 ld a,(hl)           ; find room number there.
3126   8F8D C9                 ret
3127   8F8E             
3128   8F8E             ; Screen left.
3129   8F8E             
3130   8F8E 3A 49 93    scrl   ld a,(roomtb)       ; present room table pointer.
3131   8F91 3D                 dec a               ; room left.
3132   8F92 CD 82 8F    scrl0  call tstsc          ; test screen.
3133   8F95 3C                 inc a               ; is there a screen this way?
3134   8F96 C8                 ret z               ; no, return to loop.
3135   8F97 78                 ld a,b              ; restore room displacement.
3136   8F98 32 49 93           ld (roomtb),a       ; new room table position.
3137   8F9B CD 75 8F    scrl1  call initsc         ; set new screen.
3138   8F9E 21 37 7D           ld hl,restfl        ; restart screen flag.
3139   8FA1 36 02              ld (hl),2           ; set it.
3140   8FA3 C9                 ret
3141   8FA4 3A 49 93    scrr   ld a,(roomtb)       ; room table pointer.
3142   8FA7 3C                 inc a               ; room right.
3143   8FA8 18 E8              jr scrl0
3144   8FAA 3A 49 93    scru   ld a,(roomtb)       ; room table pointer.
3145   8FAD D6 0B              sub MAPWID          ; room up.
3146   8FAF 18 E1              jr scrl0
3147   8FB1 3A 49 93    scrd   ld a,(roomtb)       ; room table pointer.
3148   8FB4 C6 0B              add a,MAPWID        ; room down.
3149   8FB6 18 DA              jr scrl0
3150   8FB8             
3151   8FB8             ; Jump to new screen.
3152   8FB8             
3153   8FB8 21 D2 93    nwscr  ld hl,mapdat        ; start of map data.
3154   8FBB 01 00 50           ld bc,256*80        ; zero room count, 80 to search.
3155   8FBE BE          nwscr0 cp (hl)             ; have we found a match for screen?
3156   8FBF 28 05              jr z,nwscr1         ; yes, set new point in map.
3157   8FC1 23                 inc hl              ; next room.
3158   8FC2 0C                 inc c               ; count rooms.
3159   8FC3 10 F9              djnz nwscr0         ; keep looking.
3160   8FC5 C9                 ret
3161   8FC6 79          nwscr1 ld a,c              ; room displacement.
3162   8FC7 32 49 93           ld (roomtb),a       ; set the map position.
3163   8FCA 18 CF              jr scrl1            ; draw new room.
3164   8FCC             
3165   8FCC             
3166   8FCC             ; Gravity processing.
3167   8FCC             
3168   8FCC DD 7E 0D    grav   ld a,(ix+13)        ; in-air flag.
3169   8FCF A7                 and a               ; are we in the air?
3170   8FD0 C8                 ret z               ; no we are not.
3171   8FD1 3C                 inc a               ; increment it.
3172   8FD2 CA 1C 90           jp z,ogrv           ; set to 255, use old gravity.
3173   8FD5 DD 77 0D           ld (ix+13),a        ; write new setting.
3174   8FD8 1F                 rra                 ; every other frame.
3175   8FD9 30 0A              jr nc,grav0         ; don't apply gravity this time.
3176   8FDB DD 7E 0E           ld a,(ix+14)        ; pixels to move.
3177   8FDE FE 10              cp 16               ; reached maximum?
3178   8FE0 28 03              jr z,grav0          ; yes, continue.
3179   8FE2 DD 34 0E           inc (ix+14)         ; slow down ascent/speed up fall.
3180   8FE5 DD 7E 0E    grav0  ld a,(ix+14)        ; get distance to move.
3181   8FE8 CB 2F              sra a               ; divide by 2.
3182   8FEA A7                 and a               ; any movement required?
3183   8FEB C8                 ret z               ; no, not this time.
3184   8FEC FE 80              cp 128              ; is it up or down?
3185   8FEE 30 0C              jr nc,gravu         ; it's up.
3186   8FF0 47          gravd  ld b,a              ; set pixels to move.
3187   8FF1 CD CC 89    gravd0 call cangd          ; can we go down?
3188   8FF4 20 15              jr nz,gravst        ; can't move down, so stop.
3189   8FF6 DD 34 08           inc (ix+8)          ; adjust new x coord.
3190   8FF9 10 F6              djnz gravd0
3191   8FFB C9                 ret
3192   8FFC ED 44       gravu  neg                 ; flip the sign so it's positive.
3193   8FFE 47                 ld b,a              ; set pixels to move.
3194   8FFF CD A9 89    gravu0 call cangu          ; can we go up?
3195   9002 C2 A3 90           jp nz,ifalls        ; can't move up, go down next.
3196   9005 DD 35 08           dec (ix+8)          ; adjust new x coord.
3197   9008 10 F5              djnz gravu0
3198   900A C9                 ret
3199   900B DD 7E 0E    gravst ld a,(ix+14)        ; jump pointer high.
3200   900E DD 36 0D 00        ld (ix+13),0        ; reset falling flag.
3201   9012 DD 36 0E 00        ld (ix+14),0        ; store new speed.
3202   9016 FE 08              cp 8                ; was speed the maximum?
3203   9018 CA 45 94    evftf  jp z,evnt15         ; yes, fallen too far.
3204   901B C9                 ret
3205   901C             
3206   901C             ; Old gravity processing for compatibility with 4.6 and 4.7.
3207   901C             
3208   901C DD 5E 0E    ogrv   ld e,(ix+14)        ; get index to table.
3209   901F 16 00              ld d,0              ; no high byte.
3210   9021 21 8F CC           ld hl,jtab          ; jump table.
3211   9024 19                 add hl,de           ; hl points to jump value.
3212   9025 7E                 ld a,(hl)           ; pixels to move.
3213   9026 FE 63              cp 99               ; reached the end?
3214   9028 20 04              jr nz,ogrv0         ; no, continue.
3215   902A 2B                 dec hl              ; go back to previous value.
3216   902B 7E                 ld a,(hl)           ; fetch that from table.
3217   902C 18 03              jr ogrv1
3218   902E DD 34 0E    ogrv0  inc (ix+14)         ; point to next table entry.
3219   9031 A7          ogrv1  and a               ; any movement required?
3220   9032 C8                 ret z               ; no, not this time.
3221   9033 FE 80              cp 128              ; is it up or down?
3222   9035 30 0C              jr nc,ogrvu         ; it's up.
3223   9037 47          ogrvd  ld b,a              ; set pixels to move.
3224   9038 CD CC 89    ogrvd0 call cangd          ; can we go down?
3225   903B 20 14              jr nz,ogrvst        ; can't move down, so stop.
3226   903D DD 34 08           inc (ix+8)          ; adjust new x coord.
3227   9040 10 F6              djnz ogrvd0
3228   9042 C9                 ret
3229   9043 ED 44       ogrvu  neg                 ; flip the sign so it's positive.
3230   9045 47                 ld b,a              ; set pixels to move.
3231   9046 CD A9 89    ogrvu0 call cangu          ; can we go up?
3232   9049 20 1D              jr nz,ogrv2         ; can't move up, go down next.
3233   904B DD 35 08           dec (ix+8)          ; adjust new x coord.
3234   904E 10 F6              djnz ogrvu0
3235   9050 C9                 ret
3236   9051 DD 5E 0E    ogrvst ld e,(ix+14)        ; get index to table.
3237   9054 16 00              ld d,0              ; no high byte.
3238   9056 21 8F CC           ld hl,jtab          ; jump table.
3239   9059 19                 add hl,de           ; hl points to jump value.
3240   905A 7E                 ld a,(hl)           ; fetch byte from table.
3241   905B FE 63              cp 99               ; is it the end marker?
3242   905D DD 36 0D 00        ld (ix+13),0        ; reset jump flag.
3243   9061 DD 36 0E 00        ld (ix+14),0        ; reset pointer.
3244   9065 C3 18 90           jp evftf
3245   9068 21 8F CC    ogrv2  ld hl,jtab          ; jump table.
3246   906B 06 00              ld b,0              ; offset into table.
3247   906D 7E          ogrv4  ld a,(hl)           ; fetch table byte.
3248   906E FE 64              cp 100              ; hit end or downward move?
3249   9070 38 04              jr c,ogrv3          ; yes.
3250   9072 23                 inc hl              ; next byte of table.
3251   9073 04                 inc b               ; next offset.
3252   9074 18 F7              jr ogrv4            ; keep going until we find crest/end of table.
3253   9076 DD 70 0E    ogrv3  ld (ix+14),b        ; set next table offset.
3254   9079 C9                 ret
3255   907A             
3256   907A             ; Initiate fall check.
3257   907A             
3258   907A DD 7E 0D    ifall  ld a,(ix+13)        ; jump pointer flag.
3259   907D A7                 and a               ; are we in the air?
3260   907E C0                 ret nz              ; if set, we're already in the air.
3261   907F DD 66 09           ld h,(ix+9)         ; y coordinate.
3262   9082 3E 10              ld a,16             ; look down 16 pixels.
3263   9084 DD 86 08           add a,(ix+8)        ; add x coordinate.
3264   9087 6F                 ld l,a              ; coords in hl.
3265   9088 22 3A 7D           ld (dispx),hl       ; set up test coordinates.
3266   908B CD DC 8A           call tstbl          ; get map address.
3267   908E CD 2A 8A           call plchk          ; block, platform check.
3268   9091 C0                 ret nz              ; it's solid, don't fall.
3269   9092 23                 inc hl              ; look right one cell.
3270   9093 CD 2A 8A           call plchk          ; block, platform check.
3271   9096 C0                 ret nz              ; it's solid, don't fall.
3272   9097 3A 3B 7D           ld a,(dispy)        ; y coordinate.
3273   909A E6 07              and 7               ; position straddling block cells.
3274   909C 28 05              jr z,ifalls         ; no more checks needed.
3275   909E 23                 inc hl              ; look to third cell.
3276   909F CD 2A 8A           call plchk          ; block, platform check.
3277   90A2 C0                 ret nz              ; it's solid, don't fall.
3278   90A3 DD 34 0D    ifalls inc (ix+13)         ; set in air flag.
3279   90A6 DD 36 0E 00        ld (ix+14),0        ; initial speed = 0.
3280   90AA C9                 ret
3281   90AB DD 7E 0D    tfall  ld a,(ix+13)        ; jump pointer flag.
3282   90AE A7                 and a               ; are we in the air?
3283   90AF C0                 ret nz              ; if set, we're already in the air.
3284   90B0 CD 7A 90           call ifall          ; do fall test.
3285   90B3 DD 7E 0D           ld a,(ix+13)        ; get falling flag.
3286   90B6 A7                 and a               ; is it set?
3287   90B7 C8                 ret z               ; no.
3288   90B8 DD 36 0D FF        ld (ix+13),255      ; we're using the table.
3289   90BC 18 AA              jr ogrv2            ; find position in table.
3290   90BE             
3291   90BE             
3292   90BE             ; Get frame data for a particular sprite.
3293   90BE             
3294   90BE 07          gfrm   rlca                ; multiple of 2.
3295   90BF 5F                 ld e,a              ; copy to de.
3296   90C0 16 00              ld d,0              ; no high byte as max sprite is 128.
3297   90C2 2A 3C 7D           ld hl,(frmptr)      ; frames used by game.
3298   90C5 19                 add hl,de           ; point to frame start.
3299   90C6 C9                 ret
3300   90C7             
3301   90C7             ; Find sprite list for current room.
3302   90C7             
3303   90C7 3A 14 7D    sprlst ld a,(scno)         ; screen number.
3304   90CA 21 D8 C6    sprls2 ld hl,nmedat        ; list of enemy sprites.
3305   90CD 47                 ld b,a              ; loop counter in b register.
3306   90CE A7                 and a               ; is it the first screen?
3307   90CF C8                 ret z               ; yes, don't need to search data.
3308   90D0 11 04 00           ld de,NMESIZ        ; bytes to skip.
3309   90D3 7E          sprls1 ld a,(hl)           ; fetch type of sprite.
3310   90D4 3C                 inc a               ; is it an end marker?
3311   90D5 28 03              jr z,sprls0         ; yes, end of this room.
3312   90D7 19                 add hl,de           ; point to next sprite in list.
3313   90D8 18 F9              jr sprls1           ; continue until end of room.
3314   90DA 23          sprls0 inc hl              ; point to start of next screen.
3315   90DB 10 F6              djnz sprls1         ; continue until room found.
3316   90DD C9                 ret
3317   90DE             
3318   90DE             
3319   90DE             ; Clear all but a single player sprite.
3320   90DE             
3321   90DE 06 0C       nspr   ld b,NUMSPR         ; sprite slots in table.
3322   90E0 DD 21 6C 92        ld ix,sprtab        ; sprite table.
3323   90E4 11 11 00           ld de,TABSIZ        ; distance to next odd/even entry.
3324   90E7 DD 7E 00    nspr0  ld a,(ix+0)         ; fetch sprite type.
3325   90EA A7                 and a               ; is it a player?
3326   90EB 28 0D              jr z,nspr1          ; yes, keep this one.
3327   90ED DD 36 00 FF        ld (ix+0),255       ; delete sprite.
3328   90F1 DD 36 05 FF        ld (ix+5),255       ; remove next type.
3329   90F5 DD 19              add ix,de           ; next sprite.
3330   90F7 10 EE              djnz nspr0          ; one less space in the table.
3331   90F9 C9                 ret
3332   90FA DD 36 00 FF nspr1  ld (ix+0),255       ; delete sprite.
3333   90FE DD 19              add ix,de           ; point to next sprite.
3334   9100 10 01              djnz nspr2          ; one less to do.
3335   9102 C9                 ret
3336   9103 DD 36 00 FF nspr2  ld (ix+0),255       ; delete sprite.
3337   9107 DD 36 05 FF        ld (ix+5),255       ; remove next type.
3338   910B DD 19              add ix,de           ; next sprite.
3339   910D 10 F4              djnz nspr2          ; one less space in the table.
3340   910F C9                 ret
3341   9110             
3342   9110             
3343   9110             ; Two initialisation routines.
3344   9110             ; Initialise sprites - copy everything from list to table.
3345   9110             
3346   9110 06 0C       ispr   ld b,NUMSPR         ; sprite slots in table.
3347   9112 DD 21 6C 92        ld ix,sprtab        ; sprite table.
3348   9116 7E          ispr2  ld a,(hl)           ; fetch byte.
3349   9117 FE FF              cp 255              ; is it an end marker?
3350   9119 C8                 ret z               ; yes, no more to do.
3351   911A DD 7E 00    ispr1  ld a,(ix+0)         ; fetch sprite type.
3352   911D FE FF              cp 255              ; is it enabled yet?
3353   911F 20 07              jr nz,ispr4         ; yes, try another slot.
3354   9121 DD 7E 05           ld a,(ix+5)         ; next type.
3355   9124 FE FF              cp 255              ; is it enabled yet?
3356   9126 28 08              jr z,ispr3          ; no, process this one.
3357   9128 11 11 00    ispr4  ld de,TABSIZ        ; distance to next odd/even entry.
3358   912B DD 19              add ix,de           ; next sprite.
3359   912D 10 EB              djnz ispr1          ; repeat for remaining sprites.
3360   912F C9                 ret                 ; no more room in table.
3361   9130 CD 65 91    ispr3  call cpsp           ; initialise a sprite.
3362   9133 10 E1              djnz ispr2          ; one less space in the table.
3363   9135 C9                 ret
3364   9136             
3365   9136             ; Initialise sprites - but not player, we're keeping the old one.
3366   9136             
3367   9136 06 0C       kspr   ld b,NUMSPR         ; sprite slots in table.
3368   9138 DD 21 6C 92        ld ix,sprtab        ; sprite table.
3369   913C 7E          kspr2  ld a,(hl)           ; fetch byte.
3370   913D FE FF              cp 255              ; is it an end marker?
3371   913F C8                 ret z               ; yes, no more to do.
3372   9140 A7                 and a               ; is it a player sprite?
3373   9141 20 06              jr nz,kspr1         ; no, add to table as normal.
3374   9143 11 04 00           ld de,NMESIZ        ; distance to next item in list.
3375   9146 19                 add hl,de           ; point to next one.
3376   9147 18 F3              jr kspr2
3377   9149 DD 7E 00    kspr1  ld a,(ix+0)         ; fetch sprite type.
3378   914C FE FF              cp 255              ; is it enabled yet?
3379   914E 20 07              jr nz,kspr4         ; yes, try another slot.
3380   9150 DD 7E 05           ld a,(ix+5)         ; next type.
3381   9153 FE FF              cp 255              ; is it enabled yet?
3382   9155 28 08              jr z,kspr3          ; no, process this one.
3383   9157 11 11 00    kspr4  ld de,TABSIZ        ; distance to next odd/even entry.
3384   915A DD 19              add ix,de           ; next sprite.
3385   915C 10 EB              djnz kspr1          ; repeat for remaining sprites.
3386   915E C9                 ret                 ; no more room in table.
3387   915F CD 65 91    kspr3  call cpsp           ; copy sprite to table.
3388   9162 10 D8              djnz kspr2          ; one less space in the table.
3389   9164 C9                 ret
3390   9165             
3391   9165             ; Copy sprite from list to table.
3392   9165             
3393   9165 7E          cpsp   ld a,(hl)           ; fetch byte from table.
3394   9166 DD 77 00           ld (ix+0),a         ; set up type.
3395   9169 DD 77 05           ld (ix+PAM1ST),a    ; set up type.
3396   916C 23                 inc hl              ; move to next byte.
3397   916D 7E                 ld a,(hl)           ; fetch byte from table.
3398   916E DD 77 06           ld (ix+6),a         ; set up image.
3399   9171 23                 inc hl              ; move to next byte.
3400   9172 7E                 ld a,(hl)           ; fetch byte from table.
3401   9173 DD 36 03 C8        ld (ix+3),200       ; set initial coordinate off screen.
3402   9177 DD 77 08           ld (ix+8),a         ; set up coordinate.
3403   917A 23                 inc hl              ; move to next byte.
3404   917B 7E                 ld a,(hl)           ; fetch byte from table.
3405   917C DD 77 09           ld (ix+9),a         ; set up coordinate.
3406   917F 23                 inc hl              ; move to next byte.
3407   9180 AF                 xor a               ; zeroes in accumulator.
3408   9181 DD 77 07           ld (ix+7),a         ; reset frame number.
3409   9184 DD 77 0A           ld (ix+10),a        ; reset direction.
3410   9187             ;       ld (ix+12),a        ; reset parameter B.
3411   9187 DD 77 0D           ld (ix+13),a        ; reset jump pointer low.
3412   918A DD 77 0E           ld (ix+14),a        ; reset jump pointer high.
3413   918D DD 36 10 FF        ld (ix+16),255      ; reset data pointer to auto-restore.
3414   9191 DD E5              push ix             ; store ix pair.
3415   9193 E5                 push hl             ; store hl pair.
3416   9194 C5                 push bc
3417   9195 CD 3F 94    evis0  call evnt09         ; perform event.
3418   9198 C1                 pop bc
3419   9199 E1                 pop hl              ; restore hl.
3420   919A DD E1              pop ix              ; restore ix.
3421   919C 11 11 00           ld de,TABSIZ        ; distance to next odd/even entry.
3422   919F DD 19              add ix,de           ; next sprite.
3423   91A1 C9                 ret
3424   91A2             
3425   91A2             ; Clear the play area window.
3426   91A2             
3427   91A2 2A 0B 7D    clw    ld hl,(wintop)      ; get coordinates of window.
3428   91A5 22 3A 7D           ld (dispx),hl       ; put into dispx for calculation.
3429   91A8 3A 0D 7D           ld a,(winhgt)       ; height of window.
3430   91AB 47                 ld b,a              ; copy to b register.
3431   91AC C5          clw3   push bc             ; store lines on stack.
3432   91AD 3A 0E 7D           ld a,(winwid)       ; width of window.
3433   91B0 08          clw2   ex af,af'           ; store column counter.
3434   91B1 CD 01 88           call gprad          ; get print address.
3435   91B4 21 00 20           ld hl,8192          ; distance between pixel and attribute.
3436   91B7 19                 add hl,de           ; hl points to attributes.
3437   91B8 EB                 ex de,hl            ; flip attributes in de, pixels in hl.
3438   91B9 3A 8D 5C           ld a,(23693)        ; get current colour attributes.
3439   91BC 06 08              ld b,8              ; pixel height of each cell.
3440   91BE 36 00       clw1   ld (hl),0           ; clear byte of screen.
3441   91C0 24                 inc h               ; one row down.
3442   91C1 12                 ld (de),a           ; reset attribute.
3443   91C2 14                 inc d               ; next screen row down.
3444   91C3 10 F9              djnz clw1
3445   91C5 21 3B 7D           ld hl,dispy         ; column position.
3446   91C8 34                 inc (hl)            ; next column.
3447   91C9 08                 ex af,af'           ; restore column counter.
3448   91CA 3D                 dec a               ; one less to do.
3449   91CB 20 E3              jr nz,clw2          ; repeat for remaining columns.
3450   91CD 3A 0C 7D           ld a,(winlft)       ; get left edge.
3451   91D0 32 3B 7D           ld (dispy),a        ; reset y.
3452   91D3 21 3A 7D           ld hl,dispx         ; line.
3453   91D6 34                 inc (hl)            ; next line down.
3454   91D7 C1                 pop bc              ; restore line counter.
3455   91D8 10 D2              djnz clw3           ; repeat down the screen.
3456   91DA 2A 0B 7D           ld hl,(wintop)      ; get coordinates of window.
3457   91DD 22 2F 7D           ld (charx),hl       ; put into display position.
3458   91E0 C9                 ret
3459   91E1             
3460   91E1             ; Effects code.
3461   91E1             ; Ticker routine is called 25 times per second.
3462   91E1             
3463   91E1 C9          scrly  ret
3464   91E2 49 80              defw txtscr         ; get screen address.
3465   91E4 06 08              ld b,8              ; 8 pixel rows.
3466   91E6 E5                 push hl             ; store screen address.
3467   91E7 C5          scrly1 push bc             ; store rows on stack.
3468   91E8 E5                 push hl
3469   91E9 3A 44 80           ld a,(txtwid)       ; characters wide.
3470   91EC 47                 ld b,a              ; put into the loop counter.
3471   91ED A7                 and a               ; reset carry flag.
3472   91EE CB 16       scrly0 rl (hl)             ; rotate left.
3473   91F0 2D                 dec l               ; char left.
3474   91F1 10 FB              djnz scrly0         ; repeat for width of ticker message.
3475   91F3 E1                 pop hl
3476   91F4 24                 inc h               ; next row down.
3477   91F5 C1                 pop bc              ; retrieve row counter from stack.
3478   91F6 10 EF              djnz scrly1         ; repeat for all rows.
3479   91F8 2A 45 80           ld hl,(txtpos)      ; get text pointer.
3480   91FB 7E                 ld a,(hl)           ; find character we're displaying.
3481   91FC E6 7F              and 127             ; remove end marker bit if applicable.
3482   91FE FE 0D              cp 13               ; is it newline?
3483   9200 20 02              jr nz,scrly5        ; no, it's okay.
3484   9202 3E 20              ld a,32             ; convert to a space instead.
3485   9204 07          scrly5 rlca
3486   9205 07                 rlca
3487   9206 07                 rlca                ; multiply by 8 to find char.
3488   9207 47                 ld b,a              ; store shift in b.
3489   9208 E6 03              and 3               ; keep within 768-byte range of font.
3490   920A 57                 ld d,a              ; that's our high byte.
3491   920B 78                 ld a,b              ; restore the shift.
3492   920C E6 F8              and 248
3493   920E 5F                 ld e,a
3494   920F 2A 36 5C           ld hl,(23606)       ; font address.
3495   9212 19                 add hl,de           ; point to image of character.
3496   9213 EB                 ex de,hl            ; need the address in de.
3497   9214 E1                 pop hl
3498   9215             
3499   9215 3A 43 80           ld a,(txtbit)
3500   9218 4F                 ld c,a
3501   9219 06 08              ld b,8
3502   921B 1A          scrly3 ld a,(de)           ; get image of char line.
3503   921C A1                 and c               ; test relevant bit of char.
3504   921D 28 01              jr z,scrly2         ; not set - skip.
3505   921F 34                 inc (hl)            ; set bit.
3506   9220 24          scrly2 inc h               ; next line of window.
3507   9221 13                 inc de              ; next line of char.
3508   9222 10 F7              djnz scrly3
3509   9224 21 43 80           ld hl,txtbit        ; bit of text to display.
3510   9227 CB 0E              rrc (hl)            ; next bit of char to use.
3511   9229 D0                 ret nc              ; not reached end of character yet.
3512   922A 2A 45 80           ld hl,(txtpos)      ; text pointer.
3513   922D 7E                 ld a,(hl)           ; what was the character?
3514   922E 23                 inc hl              ; next character in message.
3515   922F 17                 rla                 ; end of message?
3516   9230             ;       ret nc              ; not yet, exit here.
3517   9230             ;       ld a,201            ; code for ret.
3518   9230             ;       ld (scrly),a        ; disable scrolling routine.
3519   9230 30 03              jr nc,scrly6        ; not yet - continue.
3520   9232 2A 47 80    scrly4 ld hl,(txtini)      ; start of scrolling message.
3521   9235 22 45 80    scrly6 ld (txtpos),hl      ; new text pointer position.
3522   9238 C9                 ret
3523   9239             
3524   9239 CD 87 8C    iscrly call prescr         ; set up display position.
3525   923C 21 4C 94           ld hl,msgdat        ; text messages.
3526   923F 78                 ld a,b              ; width.
3527   9240 3D                 dec a               ; subtract one.
3528   9241 FE 20              cp 32               ; is it between 1 and 32?
3529   9243 30 0B              jr nc,iscrl0        ; no, disable messages.
3530   9245 79                 ld a,c              ; message number.
3531   9246 50                 ld d,b              ; copy width to d.
3532   9247 CD 90 8C           call getwrd         ; find message start.
3533   924A 42                 ld b,d              ; restore width to b register.
3534   924B 22 47 80           ld (txtini),hl      ; set initial text position.
3535   924E 3E 2A              ld a,42             ; code for ld hl,(nn).
3536   9250 32 E1 91    iscrl0 ld (scrly),a        ; enable/disable scrolling routine.
3537   9253 CD 87 8C           call prescr         ; set up display position.
3538   9256 CD 01 88           call gprad          ; get print address.
3539   9259 68                 ld l,b              ; width in b so copy to hl.
3540   925A 26 00              ld h,0              ; no high byte.
3541   925C 2B                 dec hl              ; width minus one.
3542   925D 19                 add hl,de           ; add width.
3543   925E 22 49 80           ld (txtscr),hl      ; set text screen address.
3544   9261 78                 ld a,b              ; width.
3545   9262 32 44 80           ld (txtwid),a       ; set width in working storage.
3546   9265 21 43 80           ld hl,txtbit        ; bit of text to display.
3547   9268 36 80              ld (hl),128         ; start with leftmost bit.
3548   926A 18 C6              jr scrly4
3549   926C             
3550   926C             ; Sprite table ------------------------------------------------------------------
3551   926C             
3552   926C             ; ix+0  = type.
3553   926C             ; ix+1  = sprite image number.
3554   926C             ; ix+2  = frame.
3555   926C             ; ix+3  = x coord.
3556   926C             ; ix+4  = y coord.
3557   926C             
3558   926C             ; ix+5  = new type.
3559   926C             ; ix+6  = new image number.
3560   926C             ; ix+7  = new frame.
3561   926C             ; ix+8  = new x coord.
3562   926C             ; ix+9  = new y coord.
3563   926C             
3564   926C             ; ix+10 = direction.
3565   926C             ; ix+11 = parameter 1.
3566   926C             ; ix+12 = parameter 2.
3567   926C             ; ix+13 = jump pointer low.
3568   926C             ; ix+14 = jump pointer high.
3569   926C             ; ix+15 = data pointer low.
3570   926C             ; ix+16 = data pointer high.
3571   926C             
3572   926C             
3573   926C             sprtab equ $
3574   926C             
3575   926C             ;       block NUMSPR * TABSIZ,255
3576   926C             
3577   926C                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3577   926C FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3578   927D                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3578   927D FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3579   928E                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3579   928E FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3580   929F                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3580   929F FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3581   92B0                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3581   92B0 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3582   92C1                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3582   92C1 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3583   92D2                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3583   92D2 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3584   92E3                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3584   92E3 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3585   92F4                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3585   92F4 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3586   9305                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3586   9305 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3587   9316                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3587   9316 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3588   9327                    defb 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
3588   9327 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
3589   9338             ssprit defb 255,255,255,255,255,255,255,0,192,120,0,0,0,255,255,255,255
3589   9338 FFFFFFFFFFFFFF00C078000000FFFFFFFF
3590   9349             
3591   9349 00          roomtb defb 0                      ; start room map offset.
3592   934A             
3593   934A             ; Everything below here will be generated by the editors.
3594   934A             
3595   934A             ; Sounds.
3596   934A             
3597   934A 8F          fx1    defb 128+15         ; volume and mixer.
3598   934B 1F                 defb 31             ; white noise.
3599   934C E8 03              defw 1000           ; tone register.
3600   934E 8F                 defb 128+15         ; volume and mixer.
3601   934F 19                 defb 25             ; white noise.
3602   9350 E8 03              defw 1000           ; tone register.
3603   9352 8E                 defb 128+14         ; volume and mixer.
3604   9353 13                 defb 19             ; white noise.
3605   9354 E8 03              defw 1000           ; tone register.
3606   9356 8D                 defb 128+13         ; volume and mixer.
3607   9357 0D                 defb 13             ; white noise.
3608   9358 E8 03              defw 1000           ; tone register.
3609   935A 8C                 defb 128+12         ; volume and mixer.
3610   935B 07                 defb 7              ; white noise.
3611   935C E8 03              defw 1000           ; tone register.
3612   935E 8B                 defb 128+11         ; volume and mixer.
3613   935F 00                 defb 0              ; white noise.
3614   9360 E8 03              defw 1000           ; tone register.
3615   9362 8A                 defb 128+10         ; volume and mixer.
3616   9363 06                 defb 6              ; white noise.
3617   9364 E8 03              defw 1000           ; tone register.
3618   9366 88                 defb 128+8          ; volume and mixer.
3619   9367 0C                 defb 12             ; white noise.
3620   9368 E8 03              defw 1000           ; tone register.
3621   936A 86                 defb 128+6          ; volume and mixer.
3622   936B 12                 defb 18             ; white noise.
3623   936C E8 03              defw 1000           ; tone register.
3624   936E 83                 defb 128+3          ; volume and mixer.
3625   936F 18                 defb 24             ; white noise.
3626   9370 E8 03              defw 1000           ; tone register.
3627   9372 FF                 defb 255
3628   9373             
3629   9373 4F          fx2    defb 064+15         ; volume and mixer.
3630   9374 1B                 defb 27             ; white noise.
3631   9375 E8 03              defw 1000           ; tone register.
3632   9377 4E                 defb 064+14         ; volume and mixer.
3633   9378 1F                 defb 31             ; white noise.
3634   9379 D0 07              defw 2000           ; tone register.
3635   937B 4D                 defb 064+13         ; volume and mixer.
3636   937C 1C                 defb 28             ; white noise.
3637   937D B8 0B              defw 3000           ; tone register.
3638   937F 4C                 defb 064+12         ; volume and mixer.
3639   9380 1F                 defb 31             ; white noise.
3640   9381 D0 07              defw 2000           ; tone register.
3641   9383 4B                 defb 064+11         ; volume and mixer.
3642   9384 1D                 defb 29             ; white noise.
3643   9385 E8 03              defw 1000           ; tone register.
3644   9387 4A                 defb 064+10         ; volume and mixer.
3645   9388 1F                 defb 31             ; white noise.
3646   9389 D0 07              defw 2000           ; tone register.
3647   938B 49                 defb 064+9          ; volume and mixer.
3648   938C 1E                 defb 30             ; white noise.
3649   938D B8 0B              defw 3000           ; tone register.
3650   938F 48                 defb 064+8          ; volume and mixer.
3651   9390 1F                 defb 31             ; white noise.
3652   9391 D0 07              defw 2000           ; tone register.
3653   9393 47                 defb 064+7          ; volume and mixer.
3654   9394 1F                 defb 31             ; white noise.
3655   9395 E8 03              defw 1000           ; tone register.
3656   9397 46                 defb 064+6          ; volume and mixer.
3657   9398 1F                 defb 31             ; white noise.
3658   9399 D0 07              defw 2000           ; tone register.
3659   939B FF                 defb 255
3660   939C             
3661   939C 4F          fx3    defb 064+15         ; volume and mixer.
3662   939D 00                 defb 0              ; white noise.
3663   939E A0 0F              defw 4000           ; tone register.
3664   93A0 4F                 defb 064+15         ; volume and mixer.
3665   93A1 00                 defb 0              ; white noise.
3666   93A2 04 10              defw 4100           ; tone register.
3667   93A4 4E                 defb 064+14         ; volume and mixer.
3668   93A5 00                 defb 0              ; white noise.
3669   93A6 68 10              defw 4200           ; tone register.
3670   93A8 4E                 defb 064+14         ; volume and mixer.
3671   93A9 00                 defb 0              ; white noise.
3672   93AA CC 10              defw 4300           ; tone register.
3673   93AC 4D                 defb 064+13         ; volume and mixer.
3674   93AD 00                 defb 0              ; white noise.
3675   93AE 30 11              defw 4400           ; tone register.
3676   93B0 4D                 defb 064+13         ; volume and mixer.
3677   93B1 00                 defb 0              ; white noise.
3678   93B2 94 11              defw 4500           ; tone register.
3679   93B4 4C                 defb 064+12         ; volume and mixer.
3680   93B5 00                 defb 0              ; white noise.
3681   93B6 F8 11              defw 4600           ; tone register.
3682   93B8 4C                 defb 064+12         ; volume and mixer.
3683   93B9 00                 defb 0              ; white noise.
3684   93BA 5C 12              defw 4700           ; tone register.
3685   93BC 4B                 defb 064+11         ; volume and mixer.
3686   93BD 00                 defb 0              ; white noise.
3687   93BE C0 12              defw 4800           ; tone register.
3688   93C0 4A                 defb 064+10         ; volume and mixer.
3689   93C1 00                 defb 0              ; white noise.
3690   93C2 24 13              defw 4900           ; tone register.
3691   93C4 FF                 defb 255
3692   93C5             
3693   93C5 63                 defb 99             ; temporary marker.
3694   93C6             
3695   93C6             ; User routine.  Put your own code in here to be called with USER instruction.
3696   93C6             ; if USER has an argument it will be passed in the accumulator.
3697   93C6             
3698   93C6 C9          user   ret
3699   93C7             
3700   93C7             ; Game-specific data and events code generated by the compiler ------------------
3701   93C7             
3702   93C7             
3703   93C7             WINDOWTOP equ 1
3704   93C7             WINDOWLFT equ 1
3705   93C7             WINDOWHGT equ 22
3706   93C7             WINDOWWID equ 30 ;
3707   93C7             MAPWID equ 11
3708   93C7                    defb 255,255,255,255,255,255,255,255,255,255,255
3708   93C7 FFFFFFFFFFFFFFFFFFFFFF
3709   93D2             mapdat equ $
3710   93D2                    defb 255,0,23,255,255,255,255,255,255,255,255
3710   93D2 FF0017FFFFFFFFFFFFFFFF
3711   93DD                    defb 255,255,255,255,255,255,255,255,255,255,255
3711   93DD FFFFFFFFFFFFFFFFFFFFFF
3712   93E8                    defb 255,255,255,255,255,255,255,255,255,255,255
3712   93E8 FFFFFFFFFFFFFFFFFFFFFF
3713   93F3                    defb 255,255,255,255,255,16,17,18,20,255,255
3713   93F3 FFFFFFFFFF10111214FFFF
3714   93FE                    defb 255,255,255,255,255,8,3,7,19,22,255
3714   93FE FFFFFFFFFF0803071316FF
3715   9409                    defb 255,255,255,255,15,4,1,2,6,21,255
3715   9409 FFFFFFFF0F0401020615FF
3716   9414                    defb 255,255,255,255,12,9,5,10,11,255,255
3716   9414 FFFFFFFF0C09050A0BFFFF
3717   941F                    defb 255,255,255,255,14,13,255,255,255,255,255
3717   941F FFFFFFFF0E0DFFFFFFFFFF
3718   942A                    defb 255,255,255,255,255,255,255,255,255,255,255
3718   942A FFFFFFFFFFFFFFFFFFFFFF
3719   9435 01          stmap  defb 1
3720   9436             evnt00 equ $
3721   9436 C9                 ret
3722   9437             evnt01 equ $
3723   9437 C9                 ret
3724   9438             evnt02 equ $
3725   9438 C9                 ret
3726   9439             evnt03 equ $
3727   9439 C9                 ret
3728   943A             evnt04 equ $
3729   943A C9                 ret
3730   943B             evnt05 equ $
3731   943B C9                 ret
3732   943C             evnt06 equ $
3733   943C C9                 ret
3734   943D             evnt07 equ $
3735   943D C9                 ret
3736   943E             evnt08 equ $
3737   943E C9                 ret
3738   943F             evnt09 equ $
3739   943F C9                 ret
3740   9440             evnt10 equ $
3741   9440 C9                 ret
3742   9441             evnt11 equ $
3743   9441 C9                 ret
3744   9442             evnt12 equ $
3745   9442 C9                 ret
3746   9443             evnt13 equ $
3747   9443 C9                 ret
3748   9444             evnt14 equ $
3749   9444 C9                 ret
3750   9445             evnt15 equ $
3751   9445 C9                 ret
3752   9446             evnt16 equ $
3753   9446 C9                 ret
3754   9447             evnt17 equ $
3755   9447 C9                 ret
3756   9448             evnt18 equ $
3757   9448 C9                 ret
3758   9449             evnt19 equ $
3759   9449 C9                 ret
3760   944A             evnt20 equ $
3761   944A C9                 ret
3762   944B C9          ptcusr ret
3763   944C             msgdat equ $
3764   944C 00          nummsg defb 0
3765   944D             chgfx  equ $
3766   944D                    defb 0,71,0,71,0,71,0,71,0,71,0,71,0,71,0,71
3766   944D 00470047004700470047004700470047
3767   945D                    defb 0,87,0,87,0,87,0,87,0,87,0,87,0,87,0,87
3767   945D 00570057005700570057005700570057
3768   946D                    defb 129,72,66,72,36,72,24,72,24,72,36,72,66,72,129,72
3768   946D 81484248244818481848244842488148
3769   947D                    defb 160,86,208,86,82,86,100,86,61,86,6,86,2,86,1,86
3769   947D A056D056525664563D56065602560156
3770   948D                    defb 192,86,80,86,36,86,56,86,96,86,80,86,96,86,128,86
3770   948D C0565056245638566056505660568056
3771   949D                    defb 1,86,6,86,13,86,10,86,24,86,52,86,232,86,128,86
3771   949D 015606560D560A5618563456E8568056
3772   94AD                    defb 0,86,0,86,0,86,0,86,30,86,119,86,74,86,192,86
3772   94AD 00560056005600561E5677564A56C056
3773   94BD                    defb 3,86,6,86,13,86,26,86,96,86,208,86,160,86,0,86
3773   94BD 035606560D561A566056D056A0560056
3774   94CD                    defb 129,86,246,86,45,86,18,86,0,86,0,86,0,86,0,86
3774   94CD 8156F6562D5612560056005600560056
3775   94DD                    defb 192,86,192,86,115,86,95,86,37,86,0,86,0,86,0,86
3775   94DD C056C05673565F562556005600560056
3776   94ED                    defb 0,86,0,86,128,86,224,86,48,86,88,86,44,86,23,86
3776   94ED 005600568056E056305658562C561756
3777   94FD                    defb 192,80,112,80,80,80,56,80,92,80,44,80,30,80,5,80
3777   94FD C0507050505038505C502C501E500550
3778   950D                    defb 3,80,1,80,11,80,6,80,6,80,23,80,15,80,3,80
3778   950D 035001500B500650065017500F500350
3779   951D                    defb 37,80,35,80,151,80,126,80,60,80,112,80,224,80,192,80
3779   951D 2550235097507E503C507050E050C050
3780   952D                    defb 37,80,159,80,222,80,126,80,124,80,248,80,192,80,0,80
3780   952D 25509F50DE507E507C50F850C0500050
3781   953D                    defb 0,80,0,80,36,80,162,80,159,80,255,80,249,80,192,80
3781   953D 005000502450A2509F50FF50F950C050
3782   954D                    defb 0,80,0,80,0,80,4,80,82,80,214,80,255,80,239,80
3782   954D 00500050005004505250D650FF50EF50
3783   955D                    defb 0,80,128,80,0,80,66,80,150,80,149,80,239,80,125,80
3783   955D 005080500050425096509550EF507D50
3784   956D                    defb 144,80,228,80,73,80,125,80,31,80,15,80,3,80,0,80
3784   956D 9050E45049507D501F500F5003500050
3785   957D                    defb 0,87,0,87,32,87,0,87,0,87,1,87,0,87,8,87
3785   957D 00570057205700570057015700570857
3786   958D                    defb 0,87,0,87,0,87,24,87,32,87,20,87,0,87,0,87
3786   958D 00570057005718572057145700570057
3787   959D                    defb 0,86,4,86,0,86,64,86,0,86,0,86,1,86,0,86
3787   959D 00560456005640560056005601560056
3788   95AD                    defb 193,5,188,5,114,5,122,5,80,5,64,5,56,5,129,5
3788   95AD C105BC0572057A055005400538058105
3789   95BD                    defb 0,68,95,68,85,68,74,68,0,68,95,68,85,68,0,68
3789   95BD 00445F4455444A4400445F4455440044
3790   95CD                    defb 0,4,250,4,82,4,170,4,0,4,250,4,82,4,0,4
3790   95CD 0004FA045204AA040004FA0452040004
3791   95DD                    defb 0,68,118,68,0,68,84,68,102,68,84,68,102,68,84,68
3791   95DD 00447644004454446644544466445444
3792   95ED                    defb 102,4,84,4,102,4,84,4,102,4,0,4,118,4,0,4
3792   95ED 66045404660454046604000476040004
3793   95FD                    defb 88,67,19,67,12,67,99,67,108,67,73,67,25,67,251,67
3793   95FD 584313430C4363436C4349431943FB43
3794   960D                    defb 26,67,72,67,48,67,198,67,246,67,242,67,248,67,239,67
3794   960D 1A4348433043C643F643F243F843EF43
3795   961D                    defb 95,67,31,67,12,67,75,67,32,67,83,67,0,67,3,67
3795   961D 5F431F430C434B432043534300430343
3796   962D                    defb 218,3,232,3,48,3,82,3,0,3,74,3,0,3,64,3
3796   962D DA03E8033003520300034A0300034003
3797   963D                    defb 100,111,80,111,100,111,80,111,100,111,80,111,100,111,80,111
3797   963D 646F506F646F506F646F506F646F506F
3798   964D                    defb 10,40,23,40,10,40,23,40,10,40,23,40,10,40,23,40
3798   964D 0A2817280A2817280A2817280A281728
3799   965D                    defb 0,111,255,111,170,111,85,111,0,111,170,111,0,111,0,111
3799   965D 006FFF6FAA6F556F006FAA6F006F006F
3800   966D                    defb 0,40,0,40,0,40,85,40,170,40,85,40,255,40,85,40
3800   966D 0028002800285528AA285528FF285528
3801   967D                    defb 0,23,0,23,0,23,0,23,0,23,0,23,0,23,0,23
3801   967D 00170017001700170017001700170017
3802   968D                    defb 0,70,95,70,0,70,95,70,0,70,95,70,0,70,95,70
3802   968D 00465F4600465F4600465F4600465F46
3803   969D                    defb 0,6,234,6,0,6,234,6,0,6,234,6,0,6,234,6
3803   969D 0006EA060006EA060006EA060006EA06
3804   96AD                    defb 0,70,170,70,0,70,170,70,170,70,170,70,170,70,170,70
3804   96AD 0046AA460046AA46AA46AA46AA46AA46
3805   96BD                    defb 170,6,170,6,170,6,0,6,170,6,0,6,170,6,0,6
3805   96BD AA06AA06AA060006AA060006AA060006
3806   96CD             bprop  equ $
3807   96CD 00                 defb 0
3808   96CE 00                 defb 0
3809   96CF 02                 defb 2
3810   96D0 02                 defb 2
3811   96D1 02                 defb 2
3812   96D2 02                 defb 2
3813   96D3 02                 defb 2
3814   96D4 02                 defb 2
3815   96D5 02                 defb 2
3816   96D6 02                 defb 2
3817   96D7 02                 defb 2
3818   96D8 02                 defb 2
3819   96D9 02                 defb 2
3820   96DA 02                 defb 2
3821   96DB 02                 defb 2
3822   96DC 02                 defb 2
3823   96DD 02                 defb 2
3824   96DE 02                 defb 2
3825   96DF 02                 defb 2
3826   96E0 00                 defb 0
3827   96E1 00                 defb 0
3828   96E2 00                 defb 0
3829   96E3 02                 defb 2
3830   96E4 02                 defb 2
3831   96E5 02                 defb 2
3832   96E6 02                 defb 2
3833   96E7 02                 defb 2
3834   96E8 02                 defb 2
3835   96E9 02                 defb 2
3836   96EA 02                 defb 2
3837   96EB 02                 defb 2
3838   96EC 02                 defb 2
3839   96ED 02                 defb 2
3840   96EE 02                 defb 2
3841   96EF 02                 defb 2
3842   96F0 00                 defb 0
3843   96F1 02                 defb 2
3844   96F2 02                 defb 2
3845   96F3 02                 defb 2
3846   96F4 02                 defb 2
3847   96F5             sprgfx equ $
3848   96F5                    defb 3,192,12,48,19,200,45,244,83,250,84,58,40,220,186,93,59,28,187,157,28,40,31,248,47,52,51,204,28,56,7,224
3848   96F5 03C00C3013C82DF453FA543A28DCBA5D3B1CBB9D1C281FF82F3433CC1C3807E0
3849   9715                    defb 0,240,3,12,4,242,11,125,148,254,149,14,10,55,110,151,14,199,110,231,7,10,7,254,11,205,12,243,7,14,1,248
3849   9715 00F0030C04F20B7D94FE950E0A376E970EC76EE7070A07FE0BCD0CF3070E01F8
3850   9735                    defb 0,60,0,195,129,60,66,223,165,63,165,67,194,141,219,165,195,177,219,185,129,194,129,255,66,243,195,60,129,195,0,126
3850   9735 003C00C3813C42DFA53FA543C28DDBA5C3B1DBB981C281FF42F3C33C81C3007E
3851   9755                    defb 0,15,192,48,32,79,208,183,233,79,233,80,112,163,118,233,112,236,118,238,160,112,224,127,208,188,48,207,224,112,128,31
3851   9755 000FC030204FD0B7E94FE95070A376E970EC76EEA070E07FD0BC30CFE070801F
3852   9775                    defb 3,192,12,48,19,200,47,244,91,250,92,58,168,221,42,92,187,29,59,148,156,41,31,200,47,180,51,204,28,56,7,224
3852   9775 03C00C3013C82FF45BFA5C3AA8DD2A5CBB1D3B949C291FC82FB433CC1C3807E0
3853   9795                    defb 0,240,3,12,4,242,11,253,150,254,151,14,106,55,10,151,110,199,14,229,103,10,7,242,11,237,12,243,7,14,1,248
3853   9795 00F0030C04F20BFD96FE970E6A370A976EC70EE5670A07F20BED0CF3070E01F8
3854   97B5                    defb 0,60,0,195,129,60,66,255,165,191,165,195,218,141,194,165,219,177,67,185,153,194,129,252,66,251,195,60,129,195,0,126
3854   97B5 003C00C3813C42FFA5BFA5C3DA8DC2A5DBB143B999C281FC42FBC33C81C3007E
3855   97D5                    defb 0,15,192,48,32,79,208,191,233,111,233,112,118,163,112,169,118,236,80,238,166,112,32,127,208,190,48,207,224,112,128,31
3855   97D5 000FC030204FD0BFE96FE97076A370A976EC50EEA670207FD0BE30CFE070801F
3856   97F5                    defb 7,224,28,56,51,204,47,52,31,248,28,40,187,157,59,28,186,93,40,220,84,58,83,250,45,244,19,200,12,48,3,192
3856   97F5 07E01C3833CC2F341FF81C28BB9D3B1CBA5D28DC543A53FA2DF413C80C3003C0
3857   9815                    defb 1,248,7,14,12,243,11,205,7,254,7,10,110,231,14,199,110,151,10,55,149,14,148,254,11,125,4,242,3,12,0,240
3857   9815 01F8070E0CF30BCD07FE070A6EE70EC76E970A37950E94FE0B7D04F2030C00F0
3858   9835                    defb 0,126,129,195,195,60,66,243,129,255,129,194,219,185,195,177,219,165,194,141,165,67,165,63,66,223,129,60,0,195,0,60
3858   9835 007E81C3C33C42F381FF81C2DBB9C3B1DBA5C28DA543A53F42DF813C00C3003C
3859   9855                    defb 128,31,224,112,48,207,208,188,224,127,160,112,118,238,112,236,118,233,112,163,233,80,233,79,208,183,32,79,192,48,0,15
3859   9855 801FE07030CFD0BCE07FA07076EE70EC76E970A3E950E94FD0B7204FC030000F
3860   9875                    defb 7,224,28,56,51,204,47,180,31,200,156,41,59,148,187,29,42,92,168,221,84,58,95,250,45,244,19,200,12,48,3,192
3860   9875 07E01C3833CC2FB41FC89C293B94BB1D2A5CA8DD543A5FFA2DF413C80C3003C0
3861   9895                    defb 1,248,7,14,12,243,11,237,7,242,103,10,14,229,110,199,10,151,106,55,149,14,151,254,11,125,4,242,3,12,0,240
3861   9895 01F8070E0CF30BED07F2670A0EE56EC70A976A37950E97FE0B7D04F2030C00F0
3862   98B5                    defb 0,126,129,195,195,60,66,251,129,252,153,194,67,185,219,177,194,165,218,141,165,67,165,255,66,223,129,60,0,195,0,60
3862   98B5 007E81C3C33C42FB81FC99C243B9DBB1C2A5DA8DA543A5FF42DF813C00C3003C
3863   98D5                    defb 128,31,224,112,48,207,208,190,32,127,166,112,80,238,118,236,112,169,118,163,233,80,233,127,208,183,32,79,192,48,0,15
3863   98D5 801FE07030CFD0BE207FA67050EE76EC70A976A3E950E97FD0B7204FC030000F
3864   98F5                    defb 1,64,12,0,19,204,47,246,95,218,92,59,187,21,186,85,184,221,169,221,84,59,83,250,45,246,19,204,12,0,1,64
3864   98F5 01400C0013CC2FF65FDA5C3BBB15BA55B8DDA9DD543B53FA2DF613CC0C000140
3865   9915                    defb 0,80,3,0,4,243,139,253,151,246,215,14,110,197,110,149,110,55,106,119,213,14,148,254,139,125,4,243,3,0,0,80
3865   9915 0050030004F38BFD97F6D70E6EC56E956E376A77D50E94FE8B7D04F303000050
3866   9935                    defb 0,20,0,192,193,60,98,255,165,253,181,195,91,177,91,165,219,141,218,157,181,67,165,63,98,223,193,60,0,192,0,20
3866   9935 001400C0C13C62FFA5FDB5C35BB15BA5DB8DDA9DB543A53F62DFC13C00C00014
3867   9955                    defb 0,5,0,48,48,79,216,191,105,127,237,112,86,236,86,233,118,227,118,167,237,80,233,79,216,183,48,79,0,48,0,5
3867   9955 00050030304FD8BF697FED7056EC56E976E376A7ED50E94FD8B7304F00300005
3868   9975                    defb 2,160,12,0,19,204,47,182,95,202,92,43,187,21,186,93,184,221,169,221,92,59,91,250,44,246,19,204,12,0,2,160
3868   9975 02A00C0013CC2FB65FCA5C2BBB15BA5DB8DDA9DD5C3B5BFA2CF613CC0C0002A0
3869   9995                    defb 0,168,3,0,4,243,139,237,151,242,215,10,110,197,110,151,110,55,106,119,215,14,150,254,139,61,4,243,3,0,0,168
3869   9995 00A8030004F38BED97F2D70A6EC56E976E376A77D70E96FE8B3D04F3030000A8
3870   99B5                    defb 0,42,0,192,193,60,98,251,165,252,181,194,91,177,219,165,219,141,218,157,181,195,165,191,98,207,193,60,0,192,0,42
3870   99B5 002A00C0C13C62FBA5FCB5C25BB1DBA5DB8DDA9DB5C3A5BF62CFC13C00C0002A
3871   99D5                    defb 128,10,0,48,48,79,216,190,41,127,173,112,86,236,118,233,118,227,118,167,237,112,233,111,216,179,48,79,0,48,128,10
3871   99D5 800A0030304FD8BE297FAD7056EC76E976E376A7ED70E96FD8B3304F0030800A
3872   99F5                    defb 2,128,0,48,51,200,111,244,91,250,220,58,168,221,170,93,187,29,187,149,220,42,95,202,111,180,51,200,0,48,2,128
3872   99F5 0280003033C86FF45BFADC3AA8DDAA5DBB1DBB95DC2A5FCA6FB433C800300280
3873   9A15                    defb 0,160,0,12,12,242,27,253,150,254,183,14,106,55,106,151,110,199,110,229,183,10,151,242,27,237,12,242,0,12,0,160
3873   9A15 00A0000C0CF21BFD96FEB70E6A376A976EC76EE5B70A97F21BED0CF2000C00A0
3874   9A35                    defb 0,40,0,3,131,60,70,255,165,191,173,195,218,141,218,165,219,177,91,185,173,194,165,252,70,251,131,60,0,3,0,40
3874   9A35 00280003833C46FFA5BFADC3DA8DDAA5DBB15BB9ADC2A5FC46FB833C00030028
3875   9A55                    defb 0,10,192,0,32,207,209,191,233,111,235,112,118,163,118,169,118,236,86,238,171,112,41,127,209,190,32,207,192,0,0,10
3875   9A55 000AC00020CFD1BFE96FEB7076A376A976EC56EEAB70297FD1BE20CFC000000A
3876   9A75                    defb 5,64,0,48,51,200,109,244,83,250,212,58,168,221,186,93,187,29,187,149,220,58,95,218,111,52,51,200,0,48,5,64
3876   9A75 0540003033C86DF453FAD43AA8DDBA5DBB1DBB95DC3A5FDA6F3433C800300540
3877   9A95                    defb 1,80,0,12,12,242,27,125,148,254,181,14,106,55,110,151,110,199,110,229,183,14,151,246,27,205,12,242,0,12,1,80
3877   9A95 0150000C0CF21B7D94FEB50E6A376E976EC76EE5B70E97F61BCD0CF2000C0150
3878   9AB5                    defb 0,84,0,3,131,60,70,223,165,63,173,67,218,141,219,165,219,177,91,185,173,195,165,253,70,243,131,60,0,3,0,84
3878   9AB5 00540003833C46DFA53FAD43DA8DDBA5DBB15BB9ADC3A5FD46F3833C00030054
3879   9AD5                    defb 0,21,192,0,32,207,209,183,233,79,235,80,118,163,118,233,118,236,86,238,235,112,105,127,209,188,32,207,192,0,0,21
3879   9AD5 0015C00020CFD1B7E94FEB5076A376E976EC56EEEB70697FD1BC20CFC0000015
3880   9AF5                    defb 3,192,12,32,51,192,47,180,95,200,92,40,185,148,184,28,185,157,171,221,92,59,27,250,12,246,19,204,0,56,3,224
3880   9AF5 03C00C2033C02FB45FC85C28B994B81CB99DABDD5C3B1BFA0CF613CC003803E0
3881   9B15                    defb 0,240,3,8,12,240,11,237,23,242,23,10,46,101,46,7,110,103,106,247,215,14,134,254,131,61,4,243,0,14,0,248
3881   9B15 00F003080CF00BED17F2170A2E652E076E676AF7D70E86FE833D04F3000E00F8
3882   9B35                    defb 0,60,0,194,3,60,66,251,133,252,133,194,75,153,203,129,219,153,218,189,181,195,161,191,96,207,193,60,128,3,0,62
3882   9B35 003C00C2033C42FB85FC85C24B99CB81DB99DABDB5C3A1BF60CFC13C8003003E
3883   9B55                    defb 0,15,128,48,0,207,208,190,33,127,161,112,82,230,114,224,118,230,118,175,237,112,232,111,216,51,48,79,224,0,128,15
3883   9B55 000F803000CFD0BE217FA17052E672E076E676AFED70E86FD833304FE000800F
3884   9B75                    defb 3,192,12,32,51,200,47,240,95,218,92,56,185,148,184,20,185,157,171,221,84,59,19,250,45,246,3,204,8,56,3,224
3884   9B75 03C00C2033C82FF05FDA5C38B994B814B99DABDD543B13FA2DF603CC083803E0
3885   9B95                    defb 0,240,3,8,12,242,11,252,151,246,23,14,46,101,46,5,110,103,106,247,213,14,132,254,139,125,0,243,2,14,0,248
3885   9B95 00F003080CF20BFC97F6170E2E652E056E676AF7D50E84FE8B7D00F3020E00F8
3886   9BB5                    defb 0,60,0,194,131,60,2,255,165,253,133,195,75,153,75,129,219,153,218,189,181,67,161,63,98,223,192,60,128,131,0,62
3886   9BB5 003C00C2833C02FFA5FD85C34B994B81DB99DABDB543A13F62DFC03C8083003E
3887   9BD5                    defb 0,15,128,48,32,207,192,191,105,127,225,112,82,230,82,224,118,230,118,175,237,80,232,79,216,183,48,15,224,32,128,15
3887   9BD5 000F803020CFC0BF697FE17052E652E076E676AFED50E84FD8B7300FE020800F
3888   9BF5                    defb 3,192,4,48,3,204,45,244,19,250,20,58,41,157,56,29,185,157,187,213,220,58,95,216,111,48,51,200,28,0,7,192
3888   9BF5 03C0043003CC2DF413FA143A299D381DB99DBBD5DC3A5FD86F3033C81C0007C0
3889   9C15                    defb 0,240,1,12,0,243,11,125,132,254,133,14,74,103,78,7,110,103,110,245,183,14,23,246,27,204,12,242,7,0,1,240
3889   9C15 00F0010C00F30B7D84FE850E4A674E076E676EF5B70E17F61BCC0CF2070001F0
3890   9C35                    defb 0,60,0,67,192,60,66,223,161,63,161,67,210,153,211,129,219,153,91,189,173,195,133,253,6,243,131,60,1,192,0,124
3890   9C35 003C0043C03C42DFA13FA143D299D381DB995BBDADC385FD06F3833C01C0007C
3891   9C55                    defb 0,15,192,16,48,15,208,183,232,79,232,80,116,166,116,224,118,230,86,239,235,112,97,127,193,188,32,207,0,112,0,31
3891   9C55 000FC010300FD0B7E84FE85074A674E076E656EFEB70617FC1BC20CF0070001F
3892   9C75                    defb 3,192,4,48,19,204,15,244,91,250,28,58,41,157,40,29,185,157,187,213,220,42,95,200,111,180,51,192,28,16,7,192
3892   9C75 03C0043013CC0FF45BFA1C3A299D281DB99DBBD5DC2A5FC86FB433C01C1007C0
3893   9C95                    defb 0,240,1,12,4,243,3,253,150,254,135,14,74,103,74,7,110,103,110,245,183,10,23,242,27,237,12,240,7,4,1,240
3893   9C95 00F0010C04F303FD96FE870E4A674A076E676EF5B70A17F21BED0CF0070401F0
3894   9CB5                    defb 0,60,0,67,193,60,64,255,165,191,161,195,210,153,210,129,219,153,91,189,173,194,133,252,70,251,3,60,1,193,0,124
3894   9CB5 003C0043C13C40FFA5BFA1C3D299D281DB995BBDADC285FC46FB033C01C1007C
3895   9CD5                    defb 0,15,192,16,48,79,208,63,233,111,232,112,116,166,116,160,118,230,86,239,171,112,33,127,209,190,0,207,64,112,0,31
3895   9CD5 000FC010304FD03FE96FE87074A674A076E656EFAB70217FD1BE00CF4070001F
3896   9CF5                    defb 7,192,28,0,51,200,111,48,95,216,220,58,187,213,185,157,184,29,41,157,20,58,19,250,45,244,3,204,4,48,3,192
3896   9CF5 07C01C0033C86F305FD8DC3ABBD5B99DB81D299D143A13FA2DF403CC043003C0
3897   9D15                    defb 1,240,7,0,12,242,27,204,23,246,183,14,110,245,110,103,110,7,74,103,133,14,132,254,11,125,0,243,1,12,0,240
3897   9D15 01F007000CF21BCC17F6B70E6EF56E676E074A67850E84FE0B7D00F3010C00F0
3898   9D35                    defb 0,124,1,192,131,60,6,243,133,253,173,195,91,189,219,153,219,129,210,153,161,67,161,63,66,223,192,60,0,67,0,60
3898   9D35 007C01C0833C06F385FDADC35BBDDB99DB81D299A143A13F42DFC03C0043003C
3899   9D55                    defb 0,31,0,112,32,207,193,188,97,127,235,112,86,239,118,230,118,224,116,166,232,80,232,79,208,183,48,15,192,16,0,15
3899   9D55 001F007020CFC1BC617FEB7056EF76E676E074A6E850E84FD0B7300FC010000F
3900   9D75                    defb 7,192,28,16,51,192,111,180,95,200,220,42,187,213,185,157,168,29,41,157,28,58,91,250,15,244,19,204,4,48,3,192
3900   9D75 07C01C1033C06FB45FC8DC2ABBD5B99DA81D299D1C3A5BFA0FF413CC043003C0
3901   9D95                    defb 1,240,7,4,12,240,27,237,23,242,183,10,110,245,110,103,106,7,74,103,135,14,150,254,3,253,4,243,1,12,0,240
3901   9D95 01F007040CF01BED17F2B70A6EF56E676A074A67870E96FE03FD04F3010C00F0
3902   9DB5                    defb 0,124,1,193,3,60,70,251,133,252,173,194,91,189,219,153,218,129,210,153,161,195,165,191,64,255,193,60,0,67,0,60
3902   9DB5 007C01C1033C46FB85FCADC25BBDDB99DA81D299A1C3A5BF40FFC13C0043003C
3903   9DD5                    defb 0,31,64,112,0,207,209,190,33,127,171,112,86,239,118,230,118,160,116,166,232,112,233,111,208,63,48,79,192,16,0,15
3903   9DD5 001F407000CFD1BE217FAB7056EF76E676A074A6E870E96FD03F304FC010000F
3904   9DF5                    defb 3,224,0,56,19,204,12,246,27,250,92,59,171,221,185,157,184,29,185,148,92,40,95,200,47,180,51,192,12,32,3,192
3904   9DF5 03E0003813CC0CF61BFA5C3BABDDB99DB81DB9945C285FC82FB433C00C2003C0
3905   9E15                    defb 0,248,0,14,4,243,131,61,134,254,215,14,106,247,110,103,110,7,46,101,23,10,23,242,11,237,12,240,3,8,0,240
3905   9E15 00F8000E04F3833D86FED70E6AF76E676E072E65170A17F20BED0CF0030800F0
3906   9E35                    defb 0,62,128,3,193,60,96,207,161,191,181,195,218,189,219,153,219,129,75,153,133,194,133,252,66,251,3,60,0,194,0,60
3906   9E35 003E8003C13C60CFA1BFB5C3DABDDB99DB814B9985C285FC42FB033C00C2003C
3907   9E55                    defb 128,15,224,0,48,79,216,51,232,111,237,112,118,175,118,230,118,224,82,230,161,112,33,127,208,190,0,207,128,48,0,15
3907   9E55 800FE000304FD833E86FED7076AF76E676E052E6A170217FD0BE00CF8030000F
3908   9E75                    defb 3,224,8,56,3,204,45,246,19,250,84,59,171,221,185,157,184,21,185,148,92,56,95,218,47,240,51,200,12,32,3,192
3908   9E75 03E0083803CC2DF613FA543BABDDB99DB815B9945C385FDA2FF033C80C2003C0
3909   9E95                    defb 0,248,2,14,0,243,139,125,132,254,213,14,106,247,110,103,110,5,46,101,23,14,151,246,11,252,12,242,3,8,0,240
3909   9E95 00F8020E00F38B7D84FED50E6AF76E676E052E65170E97F60BFC0CF2030800F0
3910   9EB5                    defb 0,62,128,131,192,60,98,223,161,63,181,67,218,189,219,153,91,129,75,153,133,195,165,253,2,255,131,60,0,194,0,60
3910   9EB5 003E8083C03C62DFA13FB543DABDDB995B814B9985C3A5FD02FF833C00C2003C
3911   9ED5                    defb 128,15,224,32,48,15,216,183,232,79,237,80,118,175,118,230,86,224,82,230,225,112,105,127,192,191,32,207,128,48,0,15
3911   9ED5 800FE020300FD8B7E84FED5076AF76E656E052E6E170697FC0BF20CF8030000F
3912   9EF5                    defb 191,253,85,82,234,165,245,9,184,17,223,225,172,33,148,161,205,161,164,33,135,225,136,17,144,9,160,5,64,2,191,253
3912   9EF5 BFFD5552EAA5F509B811DFE1AC2194A1CDA1A42187E188119009A0054002BFFD
3913   9F15                    defb 111,255,149,84,122,169,125,66,110,4,119,248,107,8,101,40,115,104,105,8,97,248,98,4,100,2,104,1,144,0,111,255
3913   9F15 6FFF95547AA97D426E0477F86B0865287368690861F862046402680190006FFF
3914   9F35                    defb 219,255,37,85,94,170,159,80,27,129,29,254,26,194,25,74,28,218,26,66,24,126,24,129,153,0,90,0,36,0,219,255
3914   9F35 DBFF25555EAA9F501B811DFE1AC2194A1CDA1A42187E188199005A002400DBFF
3915   9F55                    defb 246,255,73,85,151,170,39,212,70,224,135,127,134,176,134,82,135,54,134,144,134,31,70,32,38,64,22,128,9,0,246,255
3915   9F55 F6FF495597AA27D446E0877F86B0865287368690861F4620264016800900F6FF
3916   9F75                    defb 191,253,85,82,234,165,245,9,191,241,216,17,168,81,152,17,200,81,170,209,136,17,143,241,144,9,160,5,64,2,191,253
3916   9F75 BFFD5552EAA5F509BFF1D811A8519811C851AAD188118FF19009A0054002BFFD
3917   9F95                    defb 111,255,149,84,122,169,125,66,111,252,118,4,106,20,102,4,114,20,106,180,98,4,99,252,100,2,104,1,144,0,111,255
3917   9F95 6FFF95547AA97D426FFC76046A14660472146AB4620463FC6402680190006FFF
3918   9FB5                    defb 219,255,37,85,94,170,159,80,27,255,29,129,26,133,25,129,28,133,26,173,24,129,24,255,153,0,90,0,36,0,219,255
3918   9FB5 DBFF25555EAA9F501BFF1D811A8519811C851AAD188118FF99005A002400DBFF
3919   9FD5                    defb 246,255,73,85,151,170,39,212,198,255,71,96,70,161,70,96,71,33,70,171,70,32,198,63,38,64,22,128,9,0,246,255
3919   9FD5 F6FF495597AA27D4C6FF476046A14660472146AB4620C63F264016800900F6FF
3920   9FF5                    defb 128,1,127,254,106,164,127,250,112,10,84,42,112,10,80,42,80,42,112,42,85,234,80,10,95,250,32,4,95,250,128,1
3920   9FF5 80017FFE6AA47FFA700A542A700A502A502A702A55EA500A5FFA20045FFA8001
3921   A015                    defb 96,0,159,255,26,169,159,254,156,2,149,10,156,2,148,10,148,10,156,10,149,122,148,2,151,254,8,1,151,254,96,0
3921   A015 60009FFF1AA99FFE9C02950A9C02940A940A9C0A957A940297FE080197FE6000
3922   A035                    defb 24,0,231,255,70,170,167,255,167,0,165,66,167,0,165,2,165,2,167,2,165,94,165,0,165,255,66,0,165,255,24,0
3922   A035 1800E7FF46AAA7FFA700A542A700A502A502A702A55EA500A5FF4200A5FF1800
3923   A055                    defb 6,0,249,255,145,170,233,255,41,192,169,80,41,192,169,64,169,64,169,192,169,87,41,64,233,127,16,128,233,127,6,0
3923   A055 0600F9FF91AAE9FF29C0A95029C0A940A940A9C0A9572940E97F1080E97F0600
3924   A075                    defb 15,128,127,224,131,240,0,48,3,216,4,248,11,240,15,208,11,240,15,208,31,32,29,224,14,0,7,225,3,254,0,248
3924   A075 0F807FE083F0003003D804F80BF00FD00BF00FD01F201DE00E0007E103FE00F8
3925   A095                    defb 3,224,31,248,32,252,0,12,0,246,1,62,2,252,3,244,2,252,3,244,7,200,7,120,3,128,65,248,128,255,0,62
3925   A095 03E01FF820FC000C00F6013E02FC03F402FC03F407C80778038041F880FF003E
3926   A0B5                    defb 0,248,7,254,8,63,0,3,128,61,128,79,0,191,0,253,0,191,0,253,1,242,1,222,0,224,16,126,224,63,128,15
3926   A0B5 00F807FE083F0003803D804F00BF00FD00BF00FD01F201DE00E0107EE03F800F
3927   A0D5                    defb 0,62,129,255,194,15,192,0,96,15,224,19,192,47,64,63,192,47,64,63,128,124,128,119,0,56,132,31,248,15,224,3
3927   A0D5 003E81FFC20FC000600FE013C02F403FC02F403F807C80770038841FF80FE003
3928   A0F5                    defb 1,224,2,56,0,28,0,14,3,199,5,39,31,247,63,246,111,252,239,248,228,160,227,192,112,0,56,0,28,64,7,128
3928   A0F5 01E00238001C000E03C705271FF73FF66FFCEFF8E4A0E3C0700038001C400780
3929   A115                    defb 0,120,0,142,0,7,128,3,192,241,193,73,199,253,143,253,27,255,59,254,57,40,56,240,28,0,14,0,7,16,1,224
3929   A115 0078008E00078003C0F1C149C7FD8FFD1BFF3BFE392838F01C000E00071001E0
3930   A135                    defb 0,30,128,35,192,1,224,0,112,60,112,82,113,255,99,255,198,255,142,255,14,74,14,60,7,0,3,128,1,196,0,120
3930   A135 001E8023C001E000703C705271FF63FFC6FF8EFF0E4A0E3C0700038001C40078
3931   A155                    defb 128,7,224,8,112,0,56,0,28,15,156,20,220,127,216,255,241,191,227,191,131,146,3,143,1,192,0,224,0,113,0,30
3931   A155 8007E008700038001C0F9C14DC7FD8FFF1BFE3BF8392038F01C000E00071001E
3932   A175                    defb 0,4,0,2,0,2,14,2,63,195,118,163,111,215,239,215,235,247,235,246,197,110,195,252,64,112,64,0,64,0,32,0
3932   A175 0004000200020E023FC376A36FD7EFD7EBF7EBF6C56EC3FC4070400040002000
3933   A195                    defb 0,1,128,0,128,0,131,128,207,240,221,168,219,245,251,245,250,253,186,253,177,91,48,255,16,28,16,0,16,0,8,0
3933   A195 0001800080008380CFF0DDA8DBF5FBF5FAFDBAFDB15B30FF101C100010000800
3934   A1B5                    defb 64,0,32,0,32,0,32,224,51,252,55,106,118,253,126,253,126,191,110,191,236,86,204,63,4,7,4,0,4,0,2,0
3934   A1B5 40002000200020E033FC376A76FD7EFD7EBF6EBFEC56CC3F0407040004000200
3935   A1D5                    defb 16,0,8,0,8,0,8,56,12,255,141,218,93,191,95,191,223,175,219,175,187,21,243,15,193,1,1,0,1,0,0,128
3935   A1D5 10000800080008380CFF8DDA5DBF5FBFDFAFDBAFBB15F30FC101010001000080
3936   A1F5                    defb 14,0,31,0,63,128,112,192,99,192,199,224,139,210,139,241,143,209,75,209,7,227,3,198,3,14,1,252,0,248,0,112
3936   A1F5 0E001F003F8070C063C0C7E08BD28BF18FD14BD107E303C6030E01FC00F80070
3937   A215                    defb 3,128,7,192,15,224,28,48,24,240,49,248,162,244,98,252,99,244,82,244,193,248,128,241,128,195,0,127,0,62,0,28
3937   A215 038007C00FE01C3018F031F8A2F462FC63F452F4C1F880F180C3007F003E001C
3938   A235                    defb 0,224,1,240,3,248,7,12,6,60,12,126,40,189,24,191,24,253,20,189,48,126,96,60,224,48,192,31,128,15,0,7
3938   A235 00E001F003F8070C063C0C7E28BD18BF18FD14BD307E603CE030C01F800F0007
3939   A255                    defb 0,56,0,124,0,254,1,195,1,143,131,31,74,47,198,47,70,63,69,47,140,31,24,15,56,12,240,7,224,3,192,1
3939   A255 0038007C00FE01C3018F831F4A2FC62F463F452F8C1F180F380CF007E003C001
3940   A275             frmlst equ $
3941   A275 00 02              defb 0,2
3942   A277 02 02              defb 2,2
3943   A279 04 02              defb 4,2
3944   A27B 06 02              defb 6,2
3945   A27D 08 02              defb 8,2
3946   A27F 0A 02              defb 10,2
3947   A281 0C 02              defb 12,2
3948   A283 0E 02              defb 14,2
3949   A285 10 03              defb 16,3
3950   A287 13 04 17 00        defb 19,4,23,0
3951   A28B             scdat  equ $
3952   A28B                    defw 351,308,338,359,304,382,326,249,380,297,404,387,432,512,475,484,426,439,404,426,496,493,484,88
3952   A28B 5F0134015201670130017E014601F9007C01290194018301B0010002DB01E401
3952   A2AB AA01B7019401AA01F001ED01E4015800
3953   A2BB                    defb 255,0,92,22,25,33,33,25,22,0,22,25,33,33,33,38,0,22,25,33,33,25,22,0,22,25,33,33,25,22,0,0,0
3953   A2BB FF005C1619212119160016192121212600161921211916001619212119160000
3953   A2DB 00
3954   A2DC                    defb 23,24,34,34,23,24,0,23,24,34,34,34,39,0,23,24,34,34,23,24,0,23,24,34,34,23,24,0,0,0,31,32,0,0
3954   A2DC 1718222217180017182222222700171822221718001718222217180000001F20
3954   A2FC 0000
3955   A2FE                    defb 31,32,0,31,32,255,0,5,31,32,0,0,31,32,0,31,32,0,0,31,32,0,0,0,31,32,0,0,31,32,0,31,32
3955   A2FE 1F20001F20FF00051F2000001F20001F2000001F200000001F2000001F20001F
3955   A31E 20
3956   A31F                    defb 255,0,5,31,32,0,0,31,32,0,31,32,0,0,31,32,0,0,0,31,32,0,0,31,32,0,31,32,255,0,5,31,32
3956   A31F FF00051F2000001F20001F2000001F200000001F2000001F20001F20FF00051F
3956   A33F 20
3957   A340                    defb 0,0,31,32,0,31,32,0,0,31,32,0,0,0,31,32,33,33,31,32,0,31,32,33,33,33,38,0,31,32,0,0,31
3957   A340 00001F20001F2000001F200000001F2021211F20001F2021212126001F200000
3957   A360 1F
3958   A361                    defb 32,0,31,32,0,0,31,32,0,0,0,31,32,34,34,31,32,0,31,32,34,34,34,39,0,31,32,0,0,31,32,0,31
3958   A361 20001F2000001F200000001F2022221F20001F2022222227001F2000001F2000
3958   A381 1F
3959   A382                    defb 32,0,0,31,32,0,0,0,31,32,0,0,31,32,0,31,32,255,0,5,31,32,0,0,31,32,0,31,32,0,0,31,32
3959   A382 2000001F200000001F2000001F20001F20FF00051F2000001F20001F2000001F
3959   A3A2 20
3960   A3A3                    defb 0,0,0,31,32,0,0,31,32,0,31,32,255,0,5,31,32,0,0,31,32,0,31,32,0,0,31,32,0,0,0,31,32
3960   A3A3 0000001F2000001F20001F20FF00051F2000001F20001F2000001F200000001F
3960   A3C3 20
3961   A3C4                    defb 0,0,31,32,0,31,32,255,0,5,31,32,0,0,31,32,0,31,32,0,0,31,32,0,0,0,31,32,0,0,31,32,0
3961   A3C4 00001F20001F20FF00051F2000001F20001F2000001F200000001F2000001F20
3961   A3E4 00
3962   A3E5                    defb 23,24,33,33,33,38,0,23,24,33,33,23,24,0,31,32,0,0,31,32,0,0,0,36,37,0,0,36,37,0,22,26,34,34,34
3962   A3E5 17182121212600171821211718001F2000001F2000000024250000242500161A
3962   A405 222222
3963   A408                    defb 39,0,22,26,34,34,26,22,0,36,37,0,0,36,37,255,0,211
3963   A408 2700161A22221A1600242500002425FF00D3
3964   A41A                    defb 1,21,21,1,21,1,12,255,1,19,19,1,1,1,21,21,1,21,1,1,12,255,1,6,20,255,1,13,19,1,1,21,1
3964   A41A 0115150115010CFF0113130101011515011501010CFF010614FF010D13010115
3964   A43A 01
3965   A43B                    defb 21,1,1,1,13,255,1,5,20,255,1,7,19,255,1,6,19,1,1,21,1,1,1,15,14,255,1,26,15,14,255,1,6
3965   A43B 150101010DFF010514FF010713FF0106130101150101010F0EFF011A0F0EFF01
3965   A45B 06
3966   A45C                    defb 19,255,1,10,6,6,6,255,1,5,19,16,13,1,1,1,19,19,255,1,13,5,1,21,21,9,10,255,1,11,19,255,1,8
3966   A45C 13FF010A060606FF010513100D0101011313FF010D05011515090AFF010B13FF
3966   A47C 0108
3967   A47E                    defb 19,1,1,1,4,21,21,1,21,1,11,255,1,23,4,1,1,21,1,1,12,255,1,15,19,255,1,7,18,16,21,1,1,1
3967   A47E 130101010415150115010BFF01170401011501010CFF010F13FF010712101501
3967   A49E 0101
3968   A4A0                    defb 13,255,1,14,19,255,1,10,18,15,15,14,1,1,19,19,1,1,19,255,1,5,20,1,1,1,19,255,1,14,19,255,1,30
3968   A4A0 0DFF010E13FF010A120F0F0E01011313010113FF01051401010113FF010E13FF
3968   A4C0 011E
3969   A4C2                    defb 19,255,1,19,19,255,1,16,19,255,1,17,20,255,1,43,7,8,10,255,1,14,6,10,255,1,10,5,21,21,1,11,1,1,1
3969   A4C2 13FF011313FF011013FF011114FF012B07080AFF010E060AFF010A051515010B
3969   A4E2 010101
3970   A4E5                    defb 20,255,1,8,7,21,21,11,1,19,1,1,20,1,1,1,5,21,21,21,15,14,255,1,8,19,1,1,1,3,21,21,12
3970   A4E5 14FF01080715150B0113010114010101051515150F0EFF010813010101031515
3970   A505 0C
3971   A506                    defb 255,1,8,4,21,1,13,255,1,11,19,1,1,1,4,1,13,255,1,7,6,4,21,12,1,1,19,255,1,8,19,1,1
3971   A506 FF01080415010DFF010B1301010104010DFF01070604150C010113FF01081301
3971   A526 01
3972   A527                    defb 19,1,3,14,1,1,1,19,1,1,1,5,21,21,1,12,255,1,12,19,255,1,7,19,255,1,4,4,21,1,1,12,255,1,6
3972   A527 1301030E01010113010101051515010CFF010C13FF010713FF0104041501010C
3972   A547 FF0106
3973   A54A 13 FF 01 0F        defb 19,255,1,15
3974   A54E                    defb 255,1,13,19,255,1,7,19,1,1,1,31,32,35,1,1,1,19,1,1,1,19,255,1,4,20,255,1,14,31,32,35,1,1
3974   A54E FF010D13FF0107130101011F20230101011301010113FF010414FF010E1F2023
3974   A56E 0101
3975   A570                    defb 19,1,1,19,255,1,16,19,255,1,4,31,32,35,20,1,1,19,19,255,1,5,7,8,9,10,255,1,13,31,32,35,255,1,8
3975   A570 13010113FF011013FF01041F20231401011313FF01050708090AFF010D1F2023
3975   A590 FF0108
3976   A593                    defb 7,8,21,21,21,1,8,11,255,1,11,36,37,35,255,1,7,5,21,21,1,21,1,21,1,12,255,1,7,20,255,1,4
3976   A593 070815151501080BFF010B242523FF010705151501150115010CFF010714FF01
3976   A5B3 04
3977   A5B4                    defb 35,35,1,1,20,255,1,4,4,21,1,21,255,1,4,13,1,1,1,19,255,1,11,19,255,1,5,3,255,1,5,15,14
3977   A5B4 2323010114FF010404150115FF01040D01010113FF010B13FF010503FF01050F
3977   A5D4 0E
3978   A5D5                    defb 255,1,5,19,255,1,8,19,255,1,8,9,17,16,15,14,255,1,6,19,255,1,6,19,19,19,255,1,5,19,255,1,9
3978   A5D5 FF010513FF010813FF01080911100F0EFF010613FF0106131313FF010513FF01
3978   A5F5 09
3979   A5F6                    defb 20,255,1,4,19,255,1,7,19,255,1,24,19,255,1,37,19,255,1,26,36,37,255,1,12,19,255,1,10,20,255,1,4
3979   A5F6 14FF010413FF010713FF011813FF012513FF011A2425FF010C13FF010A14FF01
3979   A616 04
3980   A617                    defb 31,32,35,255,1,5,20,255,1,5,19,19,255,1,5,19,255,1,8,31,32,35,1,1,19,255,1,7,19,255,1,16,31
3980   A617 1F2023FF010514FF01051313FF010513FF01081F2023010113FF010713FF0110
3980   A637 1F
3981   A638                    defb 32,35,255,1,27,31,32,35,1,19,19,255,1,8,19,255,1,8,19,255,1,5,22,23,24,22,255,1,26,25,27,28,25
3981   A638 2023FF011B1F2023011313FF010813FF010813FF010516171816FF011A191B1C
3981   A658 19
3982   A659                    defb 35,255,1,7,20,255,1,4,6,5,8,10,255,1,7,7,8,26,29,30,26,35,255,1,6,19,1,1,1,6,5,21,1
3982   A659 23FF010714FF01040605080AFF010707081A1D1E1A23FF010613010101060515
3982   A679 01
3983   A67A                    defb 21,1,11,255,1,5,5,21,21,22,23,24,22,9,8,255,1,8,5,21,21,1,21,1,1,12,255,1,5,4,21,1,21
3983   A67A 15010BFF0105051515161718160908FF0108051515011501010CFF0105041501
3983   A69A 15
3984   A69B 0101150101         defb 1,1,21,1,1
3985   A6A0                    defb 21,1,12,255,1,6,19,255,1,7,4,21,1,21,12,255,1,8,21,1,12,255,1,4,19,255,1,9,18,1,1,1,13
3985   A6A0 15010CFF010613FF0107041501150CFF010815010CFF010413FF010912010101
3985   A6C0 0D
3986   A6C1                    defb 255,1,9,21,1,11,255,1,11,20,1,1,18,15,14,255,1,5,19,1,1,1,21,1,1,1,10,255,1,29,21,9,8
3986   A6C1 FF010915010BFF010B140101120F0EFF010513010101150101010AFF011D1509
3986   A6E1 08
3987   A6E2                    defb 9,10,1,1,1,19,255,1,10,19,255,1,6,18,17,16,1,1,21,21,1,12,1,1,19,255,1,4,19,1,19,255,1,8
3987   A6E2 090A01010113FF010A13FF010612111001011515010C010113FF0104130113FF
3987   A702 0108
3988   A704                    defb 20,255,1,5,18,1,1,1,15,13,1,1,1,19,1,1,1,19,19,1,19,255,1,14,18,17,14,255,1,11,19,1,1,1
3988   A704 14FF0105120101010F0D0101011301010113130113FF010E12110EFF010B1301
3988   A724 0101
3989   A726                    defb 7,8,10,255,1,8,19,255,1,16,6,5,21,21,1,11,255,1,4,19,255,1,18,5,255,21,4,1,1,11,1,1,19
3989   A726 07080AFF010813FF011006051515010BFF010413FF011205FF150401010B0101
3989   A746 13
3990   A747                    defb 255,1,5,19,255,1,4,20,255,1,8,4,21,1,21,1,21,1,12,255,1,9,19,255,1,12,3,1,21,1,15,1,1
3990   A747 FF010513FF010414FF0108041501150115010CFF010913FF010C030115010F01
3990   A767 01
3991   A768                    defb 12,255,1,19,19,1,1,1,18,17,14,1,18,1,1,11,255,1,5,19,255,1,21,18,1,12,1,1,1,20,255,1,10
3991   A768 0CFF01131301010112110E011201010BFF010513FF011512010C01010114FF01
3991   A788 0A
3992   A789                    defb 19,1,19,19,255,1,10,4,1,8,11,255,1,5,7,9,10,255,1,5,19,255,1,12,4,21,255,1,5,7,8,21,21
3992   A789 13011313FF010A0401080BFF010507090AFF010513FF010C0415FF0105070815
3992   A7A9 15
3993   A7AA                    defb 1,11,255,1,13,19,1,1,1,18,255,1,5,7,21,21,1,21,21,12,255,1,9,20,255,1,8,18,16,15,8,8,1
3993   A7AA 010BFF010D1301010112FF01050715150115150CFF010914FF010812100F0808
3993   A7CA 01
3994   A7CB                    defb 21,1,1,1,15,13,255,1,7,19,255,1,13,21,1,21,1,21,1,13,1,1,1,19,255,1,20,21,1,1,1,12,255,1,12
3994   A7CB 150101010F0DFF010713FF010D1501150115010D01010113FF0114150101010C
3994   A7EB FF010C
3995   A7EE                    defb 19,255,1,6,20,255,1,4,21,255,1,5,11,255,1,10,19,1,19,255,1,7,19,1,1
3995   A7EE 13FF010614FF010415FF01050BFF010A130113FF0107130101
3996   A807                    defb 21,1,12,255,1,19,19,1,1,1,4,21,255,1,4,12,1,1,19,255,1,7,19,255,1,12,4,1,21,1,1,1,14
3996   A807 15010CFF0113130101010415FF01040C010113FF010713FF010C040115010101
3996   A827 0E
3997   A828                    defb 255,1,23,4,21,1,1,16,14,255,1,6,19,255,1,10,19,255,1,4,7,8,21,1,21,255,1,8,19,255,1,8,20
3997   A828 FF011704150101100EFF010613FF010A13FF01040708150115FF010813FF0108
3997   A848 14
3998   A849                    defb 255,1,6,7,1,21,255,1,6,20,255,1,5,19,255,1,14,18,1,1,1,15,15,16,255,1,24,18,15,14,255,1,20
3998   A849 FF0106070115FF010614FF010513FF010E120101010F0F10FF0118120F0EFF01
3998   A869 14
3999   A86A                    defb 19,255,1,34,19,1,19,1,1,19,255,1,15,5,8,9,10,255,1,6,19,1,19,255,1,5,19,255,1,9,6,7,21,21
3999   A86A 13FF0122130113010113FF010F0508090AFF0106130113FF010513FF01090607
3999   A88A 1515
4000   A88C                    defb 1,1,11,255,1,10,19,255,1,8,20,1,1,5,21,21,1,1,21,1,1,11,255,1,21,4,21,1,21,21,1,1,21
4000   A88C 01010BFF010A13FF010814010105151501011501010BFF011504150115150101
4000   A8AC 15
4001   A8AD                    defb 12,255,1,7,20,255,1,5,19,255,1,7,4,21,1,21,1,21,1,1,1,11,255,1,13,19,19,19,255,1,4,4,1
4001   A8AD 0CFF010714FF010513FF01070415011501150101010BFF010D131313FF010404
4001   A8CD 01
4002   A8CE                    defb 21,255,1,6,12,255,1,4,19,255,1,5,10,1,1,1,19,1,1,19,1,1,11,21,1,1,1,21,1,1,15,14,255,1,10
4002   A8CE 15FF01060CFF010413FF01050A0101011301011301010B150101011501010F0E
4002   A8EE FF010A
4003   A8F1                    defb 21,11,1,1,1,19,255,1,5,11,255,16,4,15,14,255,1,13,12,255,1,13,19,19,255,1,13,21,12,255,1,7,19
4003   A8F1 150B01010113FF01050BFF10040F0EFF010D0CFF010D1313FF010D150CFF0107
4003   A911 13
4004   A912                    defb 255,1,18,20,1,1,12,1,19,255,1,16,19,255,1,11,11,1,1,20,255,1,5,19,255,1,18,21,1,12,255,1,23
4004   A912 FF01121401010C0113FF011013FF010B0B010114FF010513FF011215010CFF01
4004   A932 17
4005   A933 13 01 01 01        defb 19,1,1,1
4006   A937                    defb 1,20,1,4,21,21,1,12,255,1,5,19,255,1,11,19,255,1,7,3,21,1,1,13,1,1,1,20,255,1,18,19,1,1,1
4006   A937 011401041515010CFF010513FF010B13FF0107031501010D01010114FF011213
4006   A957 010101
4007   A95A                    defb 9,15,14,255,1,12,19,255,1,18,19,255,1,20,19,255,1,11,6,5,8,9,10,255,1,7,20,255,1,16,5,21,21,21
4007   A95A 090F0EFF010C13FF011213FF011413FF010B060508090AFF010714FF01100515
4007   A97A 1515
4008   A97C                    defb 1,1,11,255,1,14,19,255,1,7,5,21,1,21,21,21,1,12,255,1,17,20,255,1,4,4,21,255,1,5,12,255,1,21
4008   A97C 01010BFF010E13FF0107051501151515010CFF011114FF01040415FF01050CFF
4008   A99C 0115
4009   A99E                    defb 5,21,21,1,21,1,1,1,13,255,1,21,4,21,1,21,1,1,1,12,255,1,8,19,255,1,8,19,255,1,4,4,21
4009   A99E 05151501150101010DFF0115041501150101010CFF010813FF010813FF010404
4009   A9BE 15
4010   A9BF                    defb 1,1,1,21,1,14,1,1,20,255,1,19,3,16,1,21,1,1,12,255,1,25,18,255,1,4,11,255,1,25,4,21,1,1
4010   A9BF 01010115010E010114FF01130310011501010CFF011912FF01040BFF01190415
4010   A9DF 0101
4011   A9E1                    defb 12,255,1,4,19,1,1,1,22,23,24,22,20,1,1,1,19,255,1,4,20,1,1,1,4,21,21,1,1,11,255,1,7
4011   A9E1 0CFF010413010101161718161401010113FF01041401010104151501010BFF01
4011   AA01 07
4012   AA02                    defb 25,27,28,25,33,33,1,19,19,19,1,1,19,1,1,19,1,4,21,1,1,1,12,255,1,7,26,29,30,26,34,34,1
4012   AA02 191B1C192121011313130101130101130104150101010CFF01071A1D1E1A2222
4012   AA22 01
4013   AA23                    defb 19,255,1,5,19,19,1,1,4,21,21,1,1,1,11,255,1,6,22,23,24,22,35,35,19,255,1,9,5,21,1,21,255,1,4
4013   AA23 13FF0105131301010415150101010BFF010616171816232313FF010905150115
4013   AA43 FF0104
4014   AA46                    defb 9,10,255,1,5,31,32,35,35,1,1,1,7,8,11,1,1,7,8,8,21,1,1,1,21,1,1,1,21,1,11,255,1,4
4014   AA46 090AFF01051F20232301010107080B0101070808150101011501010115010BFF
4014   AA66 0104
4015   AA68                    defb 31,32,35,1,1,9,8,21,21,21,9,8,21,21,21,1,21,255,1,7,21,1,11,1,1,1,31,32,35,1,1,255,21,8
4015   AA68 1F20230101090815151509081515150115FF010715010B0101011F20230101FF
4015   AA88 1508
4016   AA8A                    defb 1,1,21,1,1,21,21,1,21,255,1,5,8,11,1,31,32,35,1,1,255,21,4,1,21,1,1,21,255,1,4,21,255,1,8
4016   AA8A 010115010115150115FF0105080B011F20230101FF15040115010115FF010415
4016   AAAA FF0108
4017   AAAD                    defb 21,1,10,31,32,35,1,1
4017   AAAD 15010A1F20230101
4018   AAB5                    defb 1,1,4,21,21,1,21,1,21,1,13,1,1,1,19,255,1,7,20,255,1,9,3,21,1,21,1,1,1,13,255,1,23
4018   AAB5 010104151501150115010D01010113FF010714FF0109031501150101010DFF01
4018   AAD5 17
4019   AAD6                    defb 18,1,1,15,16,14,1,1,19,255,1,8,19,255,1,7,19,1,19,1,1,1,18,14,255,1,15,19,255,1,21,22,23
4019   AAD6 1201010F100E010113FF010813FF0107130113010101120EFF010F13FF011516
4019   AAF6 17
4020   AAF7                    defb 24,22,255,1,15,19,1,1,1,20,255,1,6,25,27,28,25,255,33,13,255,1,13,26,29,30,26,255,34,13,255,1,13
4020   AAF7 1816FF010F1301010114FF0106191B1C19FF210DFF010D1A1D1E1AFF220DFF01
4020   AB17 0D
4021   AB18                    defb 22,23,24,22,255,35,13,255,1,7,19,255,1,6,31,32,35,35,255,1,24,19,1,31,32,35,255,1,5,19,255,1,6
4021   AB18 16171816FF230DFF010713FF01061F202323FF011813011F2023FF010513FF01
4021   AB38 06
4022   AB39                    defb 20,1,20,255,1,12,31,32,35,1,19,255,1,25,31,32,35,255,1,17,19,255,1,9,31,32,35,255,1,8,19,255,1,14
4022   AB39 140114FF010C1F20230113FF01191F2023FF011113FF01091F2023FF010813FF
4022   AB59 010E
4023   AB5B                    defb 20,1,1,1,31,32,35,1,20,255,1,4,19,19,255,1,19,31,32,35,255,1,4,19,1,1,19,1,1,20,1,1,19
4023   AB5B 140101011F20230114FF01041313FF01131F2023FF0104130101130101140101
4023   AB7B 13
4024   AB7C                    defb 255,1,13,31,32,35,1,1,1,19,1,1,19,255,1,16,19,1,1,1,31,32,35,255,1,18,5,8,9,10,255,1,5
4024   AB7C FF010D1F202301010113010113FF0110130101011F2023FF01120508090AFF01
4024   AB9C 05
4025   AB9D                    defb 31,32,35,255,1,12,19,1,19,1,1,1,4,21,21,1,9,10,1,1,22,23,24,22,255,1,16,7,8,21,21,1,21
4025   AB9D 1F2023FF010C13011301010104151501090A010116171816FF01100708151501
4025   ABBD 15
4026   ABBE                    defb 1,1,11,1,25,27,28,25,35,255,1,12,8,9,8,21,21,1,21,255,1,5,11,26,29,30,26,35,1,1,1,19,1
4026   ABBE 01010B01191B1C1923FF010C08090815150115FF01050B1A1D1E1A2301010113
4026   ABDE 01
4027   ABDF                    defb 20,255,1,6,21,21,21,1,1,21,1,1,1,21,1,1,1,22,23,24,22,35,255,1,9,19,1,1
4027   ABDF 14FF0106151515010115010101150101011617181623FF0109130101
4028   ABFB                    defb 255,1,6,31,32,35,1,1,1,19,255,1,23,31,32,35,255,1,19,20,255,1,7,36,37,35,255,1,28,35,35,255,1,31
4028   ABFB FF01061F202301010113FF01171F2023FF011314FF0107242523FF011C2323FF
4028   AC1B 011F
4029   AC1D                    defb 20,255,1,8,19,255,1,5,20,255,1,5,19,255,1,73,20,255,1,13,19,255,1,31,19,255,1,8,19,255,1,21,19
4029   AC1D 14FF010813FF010514FF010513FF014914FF010D13FF011F13FF010813FF0115
4029   AC3D 13
4030   AC3E                    defb 255,1,24,19,255,1,8,36,37,255,1,4,19,255,1,19,20,1,1,1,31,32,35,1,1,1,19,19,1,19,255,1,13
4030   AC3E FF011813FF01082425FF010413FF0113140101011F202301010113130113FF01
4030   AC5E 0D
4031   AC5F                    defb 6,255,1,6,31,32,35,255,1,11,20,1,19,255,1,5,7,21,9,11,1,1,1,22,23,24,22,255,1,15,22,23,24
4031   AC5F 06FF01061F2023FF010B140113FF01050715090B01010116171816FF010F1617
4031   AC7F 18
4032   AC80                    defb 22,21,21,21,12,38,33,33,25,2,2,25,255,33,15,25,27,28,25,21,1,1,1,39,34,34,26,2,2,26,255,34,15
4032   AC80 161515150C26212119020219FF210F191B1C19150101012722221A02021AFF22
4032   ACA0 0F
4033   ACA1                    defb 26,29,30,26,1,21,15,16,14,35,35,22,23,24,22,255,35,15,22,23,24,22,18,255,1,7,255,35,4,255,1,15,31
4033   ACA1 1A1D1E1A01150F100E232316171816FF230F1617181612FF0107FF2304FF010F
4033   ACC1 1F
4034   ACC2                    defb 32,35,35,4,19,255,1,16,19,255,1,7,31,32,35,1,3,1,1,19,255,1,7,19,255,1,14,31,32,35,1,1,1
4034   ACC2 2023230413FF011013FF01071F20230103010113FF010713FF010E1F20230101
4034   ACE2 01
4035   ACE3                    defb 19,255,1,13,20,255,1,4,19,255,1,4,31,32,35,1,1
4035   ACE3 13FF010D14FF010413FF01041F20230101
4036   ACF4                    defb 1,21,1,12,255,1,4,20,255,1,12,31,32,21,21,1,1,21,1,1,21,1,1,12,255,1,7,19,255,1,5,20,1,1,1
4036   ACF4 0115010CFF010414FF010C1F20151501011501011501010CFF010713FF010514
4036   AD14 010101
4037   AD17                    defb 31,32,3,21,1,21,255,1,4,21,1,12,1,19,255,1,5,19,19,1,19,255,1,5,19,31,32,35,4,21,1,1,21
4037   AD17 1F2003150115FF010415010C0113FF010513130113FF0105131F202304150101
4037   AD37 15
4038   AD38                    defb 1,21,1,1,14,255,1,9,19,255,1,7,31,32,35,3,21,255,1,6,12,255,1,15,19,1,1,31,32,35,1,3,16
4038   AD38 011501010EFF010913FF01071F20230315FF01060CFF010F1301011F20230103
4038   AD58 10
4039   AD59                    defb 255,1,5,13,255,1,12,20,255,1,5,31,32,35,1,1,1,18,17,17,21,12,255,1,7,19,255,1,11,31,32,35,1,1
4039   AD59 FF01050DFF010C14FF01051F2023010101121111150CFF010713FF010B1F2023
4039   AD79 0101
4040   AD7B                    defb 19,255,1,4,11,255,1,18,22,23,24,22,255,1,5,19,33,33,33,38,255,1,7,38,255,33,8,25,27,28,25,35,1
4040   AD7B 13FF01040BFF011216171816FF01051321212126FF010726FF2108191B1C1923
4040   AD9B 01
4041   AD9C                    defb 19,19,1,1,34,34,34,39,35,1,20,255,1,4,39,255,34,8,26,29,30,26,35,1,1,19,1,1,1,14,35,35,35
4041   AD9C 1313010122222227230114FF010427FF22081A1D1E1A230101130101010E2323
4041   ADBC 23
4042   ADBD                    defb 255,1,7,255,35,8,22,23,24,22,35,255,1,5,21,10,255,1,5,19,255,1,13,255,35,4,255,1,4,20,1,21,11
4042   ADBD FF0107FF23081617181623FF0105150AFF010513FF010DFF2304FF0104140115
4042   ADDD 0B
4043   ADDE                    defb 255,1,14,20,255,1,9,19,1,1,21,1,12,1,1,19,19,255,1,8,19,255,1,12,19,1,1,1,12,255,1,18,19
4043   ADDE FF010E14FF010913010115010C01011313FF010813FF010C130101010CFF0112
4043   ADFE 13
4044   ADFF                    defb 1,20,1,1,1,19,1,1,21,1,1,10,255,1,12,19,255,1,7,7,11,255,1,7,13,255,1,8,19,255,1,10,7
4044   ADFF 01140101011301011501010AFF010C13FF0107070BFF01070DFF010813FF010A
4044   AE1F 07
4045   AE20                    defb 21,12,255,1,6,12,255,1,4,20,255,1,15,4,21,1,11,255,1,5,13,255,1,12,20,255,1,7,3,17,17,1,9,9
4045   AE20 150CFF01060CFF010414FF010F0415010BFF01050DFF010C14FF010703111101
4045   AE40 0909
4046   AE42                    defb 10,1,12,1,1,1,19,1,19,255,1,18,4,21,21,1,21,12,255,1,6,19,255,1,13,19,1,1,1,4,21,255,1,4
4046   AE42 0A010C010101130113FF011204151501150CFF010613FF010D130101010415FF
4046   AE62 0104
4047   AE64                    defb 10,255,1,11,19,255,1,11,4,21,1,21
4047   AE64 0AFF010B13FF010B04150115
4048   AE70                    defb 21,1,12,255,1,4,19,1,1,20,255,1,17,19,1,1,21,12,255,1,9,20,255,1,19,14,19,1,1,20,255,1,12
4048   AE70 15010CFF010413010114FF0111130101150CFF010914FF01130E13010114FF01
4048   AE90 0C
4049   AE91                    defb 19,255,1,4,20,255,1,5,16,14,255,1,7,19,1,1,1,20,255,1,43,19,255,1,15,20,255,1,16,19,255,1,6
4049   AE91 13FF010414FF0105100EFF01071301010114FF012B13FF010F14FF011013FF01
4049   AEB1 06
4050   AEB2                    defb 19,255,1,4,20,255,1,7,19,255,1,44,22,23,24,22,255,1,9,20,255,1,11,255,33,5,25,27,28,25,35,255,1,15
4050   AEB2 13FF010414FF010713FF012C16171816FF010914FF010BFF2105191B1C1923FF
4050   AED2 010F
4051   AED4                    defb 19,255,1,4,255,34,5,26,29,30,26,35,255,1,20,255,35,5,22,23,24,22,35,255,1,26,36,37,35,35,255,1,4
4051   AED4 13FF0104FF22051A1D1E1A23FF0114FF23051617181623FF011A24252323FF01
4051   AEF4 04
4052   AEF5                    defb 5,8,9,10,255,1,8,20,1,1,1,19,255,1,6,35,35,255,1,5,4,21,21,1,9,10,255,1,14,19,255,1,8
4052   AEF5 0508090AFF01081401010113FF01062323FF010504151501090AFF010E13FF01
4052   AF15 08
4053   AF16                    defb 5,21,21,1,21,1,14,255,1,8,19,255,1,14,4,21,1,1,1,12,255,1,20,19,1,1,1,4,21,1,21,1,12
4053   AF16 0515150115010EFF010813FF010E04150101010CFF0114130101010415011501
4053   AF36 0C
4054   AF37                    defb 1,1,1,19,255,1,11,20,255,1,8,3,255,1,5,11,255,1,11,19,255,1,12,3,21,1,21,1,1,10,255,1,21
4054   AF37 01010113FF010B14FF010803FF01050BFF010B13FF010C0315011501010AFF01
4054   AF57 15
4055   AF58                    defb 19,1,1,4,21,255,1,4,9,10,1,1,1,7,8,9,8,255,1,6,36,37,255,1,7,4,21,1,21,1,1,1,21
4055   AF58 1301010415FF0104090A01010107080908FF01062425FF010704150115010101
4055   AF78 15
4056   AF79                    defb 8,9,8,21,21,1,21,19,255,1,5,31,32,35,1,19,255,1,4,3,21,21,255,1,5,21,21,1,1,1,21,1
4056   AF79 0809081515011513FF01051F20230113FF0104031515FF010515150101011501
4057   AF99                    defb 1,1,19,1,19,1,1,1,3,21,21,1,21,1,1,12,255,1,5,4,21,1,21,21,255,1,4,19,1,1,19,255,1,5
4057   AF99 0101130113010101031515011501010CFF01050415011515FF010413010113FF
4057   AFB9 0105
4058   AFBB                    defb 3,21,21,1,1,21,12,1,1,19,1,1,4,21,21,1,1,21,255,1,9,19,1,1,1,4,1,21,1,1,14,255,1,5
4058   AFBB 0315150101150C0101130101041515010115FF01091301010104011501010EFF
4058   AFDB 0105
4059   AFDD                    defb 4,21,1,21,255,1,15,3,21,1,1,13,20,255,1,5,4,1,21,1,1,21,1,1,21,1,20,255,1,9,3,15,14
4059   AFDD 04150115FF010F031501010D14FF01050401150101150101150114FF0109030F
4059   AFFD 0E
4060   AFFE                    defb 255,1,5,19,1,3,21,21,255,1,9,19,255,1,13,19,255,1,4,4,1,21,255,1,13,19,255,1,7,19,19,255,1,4
4060   AFFE FF01051301031515FF010913FF010D13FF0104040115FF010D13FF01071313FF
4060   B01E 0104
4061   B020                    defb 4,21,1,1,1,21,255,1,24,3,1,21,1,1,1,15,15,255,1,12,19,255,1,7,20,1,1,4,1,15,16,14,1,1,1
4061   B020 041501010115FF01180301150101010F0FFF010C13FF010714010104010F100E
4061   B040 010101
4062   B043                    defb 19,1,1,1,20,255,1,17,18,14,255,1,4,19,255,1,4,20,255,1,23,20,255,1,9,19,255,1,4,20,255,1,4
4062   B043 1301010114FF0111120EFF010413FF010414FF011714FF010913FF010414FF01
4062   B063 04
4063   B064                    defb 19,255,1,5,19,19,1,19,255,1,18,19,255,1,9,19,255,1,10,22,23,24,22,255,1,7,22,23,24,22,255,1,6
4063   B064 13FF010513130113FF011213FF010913FF010A16171816FF010716171816FF01
4063   B084 06
4064   B085                    defb 22,23,255,33,7,25,27,28,25,255,33,7,25,2,2,25,255,33,6,25,27,255,34,7,26,29,30,26,255,34,7,26,2,2
4064   B085 1617FF2107191B1C19FF210719020219FF2106191BFF22071A1D1E1AFF22071A
4064   B0A5 0202
4065   B0A7                    defb 26,255,34,6,26,29,255,35,7,22,23,24,22,255,35,7,22,23,24,22,255,35,6,22,23,1,1,19,255,1,5,255,35,4
4065   B0A7 1AFF22061A1DFF230716171816FF230716171816FF23061617010113FF0105FF
4065   B0C7 2304
4066   B0C9                    defb 1,1,19,255,1,4,31,32,35,35,1,1,1,19,1,1,35,255,1,4,19,255,1,5,20,1,1,19,255,1,5,31,32
4066   B0C9 010113FF01041F20232301010113010123FF010413FF010514010113FF01051F
4066   B0E9 20
4067   B0EA                    defb 35,1,1,1,20,255,1,4,19,255,1,15,19,1,1,31,32,35,255,1,6,19,1,1,19,255,1,6,19,255,1,6,20
4067   B0EA 2301010114FF010413FF010F1301011F2023FF010613010113FF010613FF0106
4067   B10A 14
4068   B10B                    defb 1,1,1,31,32,35,1,19,19,255,1,5,19,1,1,20,255,1,7,19,255,1,7,31,32,35,1,1,19,19,1,1,1
4068   B10B 0101011F2023011313FF010513010114FF010713FF01071F2023010113130101
4068   B12B 01
4069   B12C 13                 defb 19
4070   B12D                    defb 21,21,1,21,255,1,10,31,32,35,1,1,19,1,19,255,1,7,19,21,1,16,255,1,11,31,32,35,1,1,19,255,1,6
4070   B12D 15150115FF010A1F20230101130113FF010713150110FF010B1F2023010113FF
4070   B14D 0106
4071   B14F                    defb 19,255,1,4,13,1,4,21,1,1,1,14,8,3,21,1,21,31,32,35,255,1,14,10,7,21,21,1,1,12,1,1,1
4071   B14F 13FF01040D0104150101010E08031501151F2023FF010E0A07151501010C0101
4071   B16F 01
4072   B170                    defb 3,21,1,31,32,35,19,255,1,8,19,20,1,1,21,1,1,21,1,21,1,1,11,1,1,1,4,1,31,32,35,1,1
4072   B170 0315011F202313FF01081314010115010115011501010B01010104011F202301
4072   B190 01
4073   B191                    defb 20,255,1,12,21,255,1,6,9,10,5,21,1,31,32,35,255,1,18,15,17,1,1,21,1,21,21,1,31,32,35,255,1,6
4073   B191 14FF010C15FF0106090A0515011F2023FF01120F11010115011515011F2023FF
4073   B1B1 0106
4074   B1B3                    defb 19,255,1,6,15,16,15,15,14,1,1,18,17,255,1,4,21,31,32,35,255,1,14,20,1,1,19,255,1,4,18,1,1
4074   B1B3 13FF01060F100F0F0E01011211FF0104151F2023FF010E14010113FF01041201
4074   B1D3 01
4075   B1D4                    defb 21,1,31,32,35,255,1,12,19,255,1,8,20,1,18,1,1,1,31,32,35,255,1,5,20,255,1,7,19,19,255,1,9
4075   B1D4 15011F2023FF010C13FF01081401120101011F2023FF010514FF01071313FF01
4075   B1F4 09
4076   B1F5                    defb 11,1,1,31,32,35,1,1,19,255,1,6,19,255,1,4,20,19,1,1,19,255,1,4,19,12,1,21,31,32,35,1,19
4076   B1F5 0B01011F2023010113FF010613FF01041413010113FF0104130C01151F202301
4076   B215 13
4077   B216                    defb 255,1,6,19,1,19,255,1,9,19,1,1,1,12,21,1,31,32,35,255,1,13,24,22,1,1,19,255,1,4,19,1,5
4077   B216 FF0106130113FF0109130101010C15011F2023FF010D1816010113FF01041301
4077   B236 05
4078   B237                    defb 21,22,23,24,22,255,1,13,28,25,255,33,11,25,27,28,25,35,255,1,11,19,30,26,255,34,11,26,29,30,26,35,1,1
4078   B237 1516171816FF010D1C19FF210B191B1C1923FF010B131E1AFF220B1A1D1E1A23
4078   B257 0101
4079   B259                    defb 19,255,1,5,20,1,1,1,24,22,255,35,11,22,23,24,22,35,255,1,12,35,35,35,255,1,11,255,35,4,255,1,4
4079   B259 13FF0105140101011816FF230B1617181623FF010C232323FF010BFF2304FF01
4079   B279 04
4080   B27A                    defb 19,255,1,14,19,255,1,4,20,255,1,11,19,255,1,7,20,1,1,19,255,1,15,20,1,19,255,1,16,19,255,1,6
4080   B27A 13FF010E13FF010414FF010B13FF010714010113FF010F140113FF011013FF01
4080   B29A 06
4081   B29B                    defb 19,255,1,10,19,1,19,255,1,10,19,1,19,255,1,11,20,1,1,1,19
4081   B29B 13FF010A130113FF010A130113FF010B1401010113
4082   B2B0                    defb 21,21,1,21,1,21,1,12,1,1,19,1,1,4,21,21,1,1,21,255,1,6,21,1,21,1,21,8,9,10,1,21,1,1
4082   B2B0 151501150115010C0101130101041515010115FF0106150115011508090A0115
4082   B2D0 0101
4083   B2D2                    defb 12,1,19,1,1,1,4,21,1,21,255,1,7,15,16,1,1,21,1,21,21,1,11,1,1,1,14,1,1,19,1,1,18
4083   B2D2 0C011301010104150115FF01070F10010115011515010B0101010E0101130101
4083   B2F2 12
4084   B2F3                    defb 17,16,255,1,4,21,1,1,14,1,1,18,255,1,4,21,1,12,1,1,12,1,1,20,255,1,6,18,15,15,16,15,16
4084   B2F3 1110FF01041501010E010112FF010415010C01010C010114FF0106120F0F100F
4084   B313 10
4085   B314                    defb 13,1,1,19,1,18,16,16,1,1,1,13,1,1,12,19,255,1,7,19,255,1,4,20,1,1,1,19,255,1,5,15,15
4085   B314 0D010113011210100101010D01010C13FF010713FF01041401010113FF01050F
4085   B334 0F
4086   B335                    defb 14,1,1,1,12,255,1,4,19,255,1,10,19,255,1,13,13,255,1,6,20,255,1,16,21,1,1,21,1,12,1,1,1
4086   B335 0E0101010CFF010413FF010A13FF010D0DFF010614FF011015010115010C0101
4086   B355 01
4087   B356                    defb 19,255,1,4,19,19,1,1,19,255,1,5,20,1,1,19,255,1,4,21,1,1,12,22,23,24,22,255,1,6,19,255,1,13
4087   B356 13FF01041313010113FF010514010113FF01041501010C16171816FF010613FF
4087   B376 010D
4088   B378                    defb 255,33,6,25,27,28,25,255,33,20,255,34,6,26,29,30,26,255,34,20,1,1,12,35,35,35,22,23,24,22,255,35,20
4088   B378 FF2106191B1C19FF2114FF22061A1D1E1AFF221401010C23232316171816FF23
4088   B398 14
4089   B399                    defb 1,1,12,255,1,4,36,37,35,35,255,1,4,19,1,19,1,19,255,1,9,19,21,1,12,255,1,5,35,35,255,1,8
4089   B399 01010CFF010424252323FF01041301130113FF01091315010CFF01052323FF01
4089   B3B9 08
4090   B3BA                    defb 19,255,1,8,19,255,1,4,13,1,19,1,20,255,1,13,20,255,1,6,19,19,1,21,12,255,1,10,19,255,1,14,19
4090   B3BA 13FF010813FF01040D01130114FF010D14FF0106131301150CFF010A13FF010E
4090   B3DA 13
4091   B3DB                    defb 1,1,1,12,255,1,6,19,255,1,4,20,255,1,9,19,1,1,20,255,1,4,12,255,1,5,19,255,1,10,19,255,1,9
4091   B3DB 0101010CFF010613FF010414FF010913010114FF01040CFF010513FF010A13FF
4091   B3FB 0109
4092   B3FD                    defb 19,1,1,1,11,1,20,255,1,8,5,8,8,10,255,1,13,21,1,1,11,255,1,9,4,21,21,12,255,1,4,5,11
4092   B3FD 130101010B0114FF01080508080AFF010D1501010BFF01090415150CFF010405
4092   B41D 0B
4093   B41E                    defb 1,1,1,19,255,1,4,21,1,12,1,1,1,36,37,1,1,7,8,21,1,1,1,18,17,17,14,21,1,11,1,1,1
4093   B41E 01010113FF010415010C010101242501010708150101011211110E15010B0101
4093   B43E 01
4094   B43F                    defb 19,1,19,21,1,1,1,8,8,9,31,32,8,8,21,21,1,21,1,21,1,1,1,21,1,21,1,8,11,1,1,19,1
4094   B43F 130113150101010808091F20080815150115011501010115011501080B010113
4094   B45F 01
4095   B460                    defb 1,19,255,1,4,31,32,35,1,1,1,19,1,1,4,21,1,1,21,255,1,10,19,1,1,20,1,1,31,32,35,255,1,6
4095   B460 0113FF01041F20230101011301010415010115FF010A1301011401011F2023FF
4095   B480 0106
4096   B482                    defb 3,21,1,21,1,1,21,255,1,7,21,255,1,6,31,32,35,1,19,255,1,5,4,21,255,1,17,19,31,32,35,1,1,1
4096   B482 03150115010115FF010715FF01061F20230113FF01050415FF0111131F202301
4096   B4A2 0101
4097   B4A4                    defb 19,1,1,1,3,1,1,21,1,1,21,1,15,16,16,1,1,21,1,1,19,1,1,1,31,32,35,255,1,4,19,1,1,1
4097   B4A4 1301010103010115010115010F10100101150101130101011F2023FF01041301
4097   B4C4 0101
4098   B4C6                    defb 4,255,1,5,12,1,1,1,3,21,255,1,6,22,23,24,22,255,1,8,4,21,1,21,1,1,12,1,1,19,1,4,21
4098   B4C6 04FF01050C0101010315FF010616171816FF01080415011501010C0101130104
4098   B4E6 15
4099   B4E7                    defb 255,1,5,25,27,28,25,35,255,1,7,4,21,21,1,1,1,13,255,1,4,3,1,1,20,1,1,1,26,29,30,26,35
4099   B4E7 FF0105191B1C1923FF01070415150101010DFF0104030101140101011A1D1E1A
4099   B507 23
4100   B508                    defb 1,1,20,1,1,19,1,4,21,1,1,15,14,255,1,6,4,255,1,5,22,23,24,22,35,255,1,5,19,1,3,1,1
4100   B508 01011401011301041501010F0EFF010604FF01051617181623FF010513010301
4100   B528 01
4101   B529                    defb 12,1,1,20,1,19,1,1,5,255,1,4,19,1,1,31,32,35,35,255,1,8,3,21,12,255,1,7,4,21,19,1,1,1
4101   B529 0C0101140113010105FF01041301011F202323FF010803150CFF010704151301
4101   B549 0101
4102   B54B                    defb 20,1,31,32,35,1,1,1,19,255,1,6,4,12,255,1,7,4,21,255,1,6,31,32,35,255,1,8,19,1,18,14,1
4102   B54B 14011F202301010113FF0106040CFF01070415FF01061F2023FF01081301120E
4102   B56B 01
4103   B56C                    defb 19,255,1,5,3,1,8,9,10,1,1,19,31,32,35,1,19,255,1,5,20,255,1,9,19,1,1,4,21,21,1,11,1,1
4103   B56C 13FF0105030108090A0101131F20230113FF010514FF0109130101041515010B
4103   B58C 0101
4104   B58E                    defb 31,32,35,255,1,16,19,1,1,5,21,1,21,1,1,8,8,31,32,35,255,1,13,19,1,20,1,1,1,4,21,21,1,1
4104   B58E 1F2023FF011013010105150115010108081F2023FF010D130114010101041515
4104   B5AE 0101
4105   B5B0                    defb 21,1,21,31,32,35,1,20,255,1,4,19,255,1,4,19,19,255,1,6,4,1,1,21,255,1,4,31,32,35,255,1,5
4105   B5B0 1501151F20230114FF010413FF01041313FF010604010115FF01041F2023FF01
4105   B5D0 05
4106   B5D1                    defb 19,255,1,10,5,8,8,255,1,8,31,32,9,8,10,1,1,19,1,19,255,1,4,20,255,1,4,4,21,21,255,1,5
4106   B5D1 13FF010A050808FF01081F2009080A0101130113FF010414FF0104041515FF01
4106   B5F1 05
4107   B5F2                    defb 21,1,1,31,32,21,21,12,1,1,1,19,1,5,8,10,1,1,1,19,1,7,21,1,21,1,1,1,21,1,1,1,7
4107   B5F2 1501011F2015150C010101130105080A01010113010715011501010115010101
4107   B612 07
4108   B613                    defb 31,32,1,21,1,11,16,1,1,1,4,21,1,8,8,9,8,8,21,1,21,255,1,6,6,5,21,31,32,10,1,21,1,1
4108   B613 1F200115010B100101010415010808090808150115FF01060605151F200A0115
4108   B633 0101
4109   B635                    defb 11,15,5,21,21,21,1,21,255,1,4,21,1,1,21,1,1,1,5,21,21,1,31,32,1,11,255,1,5,21,1,21,255,1,4
4109   B635 0B0F051515150115FF010415010115010101051515011F20010BFF0105150115
4109   B655 FF0104
4110   B658                    defb 21,1,1,1,21,1,1,1
4110   B658 1501010115010101
4111   B660                    defb 21,1,1,16,17,1,21,255,1,5,16,15,16,1,1,21,1,1,1,21,1,1,1,12,1,1,19,1,1,1,14,1,1
4111   B660 15010110110115FF0105100F10010115010101150101010C0101130101010E01
4111   B680 01
4112   B681                    defb 18,1,21,1,15,15,14,1,1,1,4,21,1,1,21,1,1,21,1,1,14,19,255,1,4,13,1,19,1,1,18,15,13
4112   B681 120115010F0F0E010101041501011501011501010E13FF01040D01130101120F
4112   B6A1 0D
4113   B6A2                    defb 255,1,6,3,21,1,1,1,21,21,1,1,12,255,1,5,12,1,19,255,1,8,19,1,1,19,1,4,21,1,1,1,21
4113   B6A2 FF01060315010101151501010CFF01050C0113FF010813010113010415010101
4113   B6C2 15
4114   B6C3                    defb 1,1,13,1,1,1,19,19,1,11,255,1,4,19,1,1,1,19,255,1,5,4,1,21,255,1,4,14,1,1,1,20,19
4114   B6C3 01010D0101011313010BFF01041301010113FF0105040115FF01040E01010114
4114   B6E3 13
4115   B6E4                    defb 1,1,12,1,1,20,255,1,9,20,1,3,21,21,21,1,1,12,255,1,7,21,12,255,1,8,19,1,1,19,1,1,1
4115   B6E4 01010C010114FF010914010315151501010CFF0107150CFF0108130101130101
4115   B704 01
4116   B705                    defb 17,1,1,21,1,12,255,1,9,11,1,19,255,1,7,19,1,19,1,1,1,18,1,1,15,13,1,1,19,255,1,4,21
4116   B705 11010115010CFF01090B0113FF01071301130101011201010F0D010113FF0104
4116   B725 15
4117   B726                    defb 1,12,19,255,1,15,18,14,255,1,10,21,12,1,19,19,1,1,1,19,255,1,8,19,255,1,6,20,1,19,1,19,21
4117   B726 010C13FF010F120EFF010A150C01131301010113FF010813FF01061401130113
4117   B746 15
4118   B747                    defb 1,13,1,19,255,1,18,19,255,1,4,19,1,1,12,1,1,1,19,255,1,4,20,1,1,19,255,1,17,12,255,1,5
4118   B747 010D0113FF011213FF01041301010C01010113FF010414010113FF01110CFF01
4118   B767 05
4119   B768                    defb 19,255,1,4,19,1,19,255,1,5,19,255,1,6,7,8,8,1,1,11,255,1,18,19,1,1,5,8,8,21,1,21,1,1
4119   B768 13FF0104130113FF010513FF010607080801010BFF0112130101050808150115
4119   B788 0101
4120   B78A                    defb 13,1,19,255,1,11,19,1,1,1,19,1,1,5,1,21,21,1,21,1,21,12,255,1,16,20,1,1,1,5,21,1,1
4120   B78A 0D0113FF010B1301010113010105011515011501150CFF011014010101051501
4120   B7AA 01
4121   B7AB                    defb 21,255,1,4,12,19,255,1,5,20,1,1,19,255,1,10,4,1,21,1,1,21,255,1,4,11,1,19,255,1,5,19,19
4121   B7AB 15FF01040C13FF010514010113FF010A040115010115FF01040B0113FF010513
4121   B7CB 13
4122   B7CC                    defb 1,19,255,1,7,5,1,21,1,1,21,1,1,1,21,1,1,11,255,1,8,19,255,1,5,19,1,1,4,21,1,21,1,1,1
4122   B7CC 0113FF01070501150101150101011501010BFF010813FF010513010104150115
4122   B7EC 010101
4123   B7EF                    defb 21,1,1,21,1,13,255,1,5,19,255,1,10,7,1,21,255,1,6,21,1,1,1,11,1,1,7,8,9,9,8,9,10
4123   B7EF 15010115010DFF010513FF010A070115FF0106150101010B0101070809090809
4123   B80F 0A
4124   B810                    defb 7,8,9,10,7,8,8,21,1,1,1,21,255,1,5,21,1,1,1,9,8,1,21,1,1,21,21,1,1,21,1,21,1
4124   B810 0708090A0708081501010115FF01051501010109080115010115150101150115
4124   B830 01
4125   B831                    defb 21,21,1,21,255,1,5,21,1,1
4125   B831 15150115FF0105150101
4126   B83B                    defb 21,11,255,1,4,19,255,1,8,20,1,1,1,19,255,1,4,3,21,21,255,1,5,11,255,1,4,20,1,1,19,255,1,6
4126   B83B 150BFF010413FF01081401010113FF0104031515FF01050BFF010414010113FF
4126   B85B 0106
4127   B85D                    defb 19,19,1,19,255,1,4,4,21,1,21,1,21,22,23,24,22,255,1,6,19,255,1,10,22,23,24,22,1,21,1,1,1
4127   B85D 13130113FF010404150115011516171816FF010613FF010A1617181601150101
4127   B87D 01
4128   B87E                    defb 25,27,28,25,255,33,17,25,27,28,25,18,17,16,16,1,26,29,30,26,255,34,17,26,29,30,26,35,255,1,4,22,23
4128   B87E 191B1C19FF2111191B1C1912111010011A1D1E1AFF22111A1D1E1A23FF010416
4128   B89E 17
4129   B89F                    defb 24,22,255,35,12,4,21,1,21,1,22,23,24,22,35,1,1,19,1,1,13,35,35,35,1,19,255,1,9,4,21,21,1,1,1
4129   B89F 1816FF230C0415011501161718162301011301010D2323230113FF0109041515
4129   B8BF 010101
4130   B8C2                    defb 14,35,35,35,255,1,4,12,255,1,6,19,255,1,4,19,1,1,1,3,1,1,21,1,12,255,1,5,20,1,1,13,1
4130   B8C2 0E232323FF01040CFF010613FF01041301010103010115010CFF01051401010D
4130   B8E2 01
4131   B8E3                    defb 19,1,1,1,19,1,19,1,20,255,1,4,19,1,3,1,1,1,13,255,1,4,19,1,1,12,19,1,1,1,20,255,1,9
4131   B8E3 130101011301130114FF01041301030101010DFF01041301010C1301010114FF
4131   B903 0109
4132   B905                    defb 19,1,1,1,3,15,14,255,1,4,19,255,1,4,11,255,1,13,19,255,1,6,20,255,1,8,12,255,1,11,7,10,1
4132   B905 13010101030F0EFF010413FF01040BFF010D13FF010614FF01080CFF010B070A
4132   B925 01
4133   B926                    defb 19,1,1,19,255,1,10,21,12,255,1,11,4,21,10,1,1,20,255,1,5,19,1,1,1,19,1,1,12,1,19,19,1,1,1
4133   B926 13010113FF010A150CFF010B04150A010114FF0105130101011301010C011313
4133   B946 010101
4134   B949                    defb 20,255,1,4,3,21,21,10,255,1,5,19,1,19,19,1,20,255,1,4,11,1,19,1,19,255,1,7,3,21,1,9,10
4134   B949 14FF01040315150AFF0105130113130114FF01040B01130113FF010703150109
4134   B969 0A
4135   B96A                    defb 255,1,4,19,255,1,7,21,12,255,1,5,19,255,1,6,4,1,1,12,1,19,255,1,5,7,8,9,8,21,1,1,11
4135   B96A FF010413FF0107150CFF010513FF01060401010C0113FF010507080908150101
4135   B98A 0B
4136   B98B                    defb 255,1,8,19,1,1,4,21,1,12,255,1,6,7,21,21,255,1,6,9,8,11,255,1,6,19,1,4,1,21,1,8,11
4136   B98B FF01081301010415010CFF0106071515FF010609080BFF010613010401150108
4136   B9AB 0B
4137   B9AC                    defb 1,19,1,1,3,21,1,21,255,1,5,21,21,12,1,1,1,20,1,1,1,5,1,21,1,1,1,12,255,1,5,4,21
4137   B9AC 0113010103150115FF010515150C010101140101010501150101010CFF010504
4137   B9CC 15
4138   B9CD                    defb 1,1,21,1,1,21,1,21,1,11,255,1,4,19,1,4,21,1,21,1,1,1,11,6,6,6,5,21,1,1,21,21,21
4138   B9CD 0101150101150115010BFF01041301041501150101010B060606051501011515
4138   B9ED 15
4139   B9EE                    defb 255,1,5,12,1,1,1,19,1,1,4,21,1,1,1,21,255,1,4,21,1,21,255,1,4,21,1,21,1,1,1,12,1
4139   B9EE FF01050C010101130101041501010115FF0104150115FF01041501150101010C
4139   BA0E 01
4140   BA0F                    defb 19,1,1,1,5,21,1,21,255,1,8,21,1,1,1,21
4140   BA0F 1301010105150115FF01081501010115
4141   BA1F                    defb 21,21,1,12,1,1,19,255,1,5,19,255,1,4,19,1,1,1,31,32,35,255,1,8,21,12,255,1,6,19,19,1,1,1
4141   BA1F 1515010C010113FF010513FF0104130101011F2023FF0108150CFF0106131301
4141   BA3F 0101
4142   BA41                    defb 20,255,1,4,22,23,24,22,1,1,19,1,1,1,255,33,20,25,2,2,25,35,1,1,1,20,1,255,34,20,26,2,2
4142   BA41 14FF010416171816010113010101FF211419020219230101011401FF22141A02
4142   BA61 02
4143   BA62                    defb 26,35,255,1,6,21,1,1,1,11,255,35,14,22,23,24,22,35,255,1,4,19,21,21,21,1,1,12,255,1,5,19,255,1,9
4143   BA62 1A23FF0106150101010BFF230E1617181623FF01041315151501010CFF010513
4143   BA82 FF0109
4144   BA85                    defb 31,32,35,35,1,20,1,19,1,1,21,1,1,1,12,1,19,255,1,4,19,255,1,6,20,1,31,32,35,255,1,6,21
4144   BA85 1F202323011401130101150101010C0113FF010413FF010614011F2023FF0106
4144   BAA5 15
4145   BAA6                    defb 1,21,1,1,13,20,255,1,9,19,255,1,4,31,32,35,1,19,1,1,19,255,1,5,12,19,255,1,15,31,32,35,1,1,1
4145   BAA6 011501010D14FF010913FF01041F20230113010113FF01050C13FF010F1F2023
4145   BAC6 010101
4146   BAC9                    defb 19,1,1,21,1,21,1,12,255,1,5,19,255,1,10,31,32,35,20,1,1,1,19,255,1,4,21,13,1,1,19,255,1,13
4146   BAC9 130101150115010CFF010513FF010A1F20231401010113FF0104150D010113FF
4146   BAE9 010D
4147   BAEB                    defb 31,32,35,255,1,6,21,1,1,1,11,1,1,1,19,255,1,4,20,1,1,1,19,1,1,19,31,32,35,1,19,1,1
4147   BAEB 1F2023FF0106150101010B01010113FF010414010101130101131F2023011301
4147   BB0B 01
4148   BB0C                    defb 19,1,1,21,1,1,13,1,19,19,255,1,13,31,32,35,255,1,8,15,14,1,1,19,255,1,6,19,255,1,7,31,32
4148   BB0C 1301011501010D011313FF010D1F2023FF01080F0E010113FF010613FF01071F
4148   BB2C 20
4149   BB2D                    defb 35,255,1,7,12,255,1,10,19,255,1,8,31,32,35,1,1,19,255,1,4,12,1,19,255,1,15,19,1,31,32,35,255,1,4
4149   BB2D 23FF01070CFF010A13FF01081F2023010113FF01040C0113FF010F13011F2023
4149   BB4D FF0104
4150   BB50                    defb 20,1,1,13,255,1,4,20,255,1,6,19,255,1,4,19,1,1,31,32,35,255,1,5,19,1,11,255,1,6,19,255,1,12
4150   BB50 1401010DFF010414FF010613FF01041301011F2023FF010513010BFF010613FF
4150   BB70 010C
4151   BB72                    defb 31,32,35,1,19,255,1,4,21,1,10,255,1,18,31,32,35,19,1,1,1,19,19,21,21,1,11,255,1,5,19,255,1,6
4151   BB72 1F20230113FF010415010AFF01121F20231301010113131515010BFF010513FF
4151   BB92 0106
4152   BB94                    defb 20,255,1,4,31,32,35,255,1,5,19,21,1,1,12,1,1,19,255,1,8,19,255,1,4,19,31,32,35,1,20,255,1,5
4152   BB94 14FF01041F2023FF0105131501010C010113FF010813FF0104131F20230114FF
4152   BBB4 0105
4153   BBB6                    defb 21,1,12,255,1,12,19,255,1,4,31,32,35,1,1,1,19,1,1
4153   BBB6 15010CFF010C13FF01041F2023010101130101
4154   BBC9                    defb 21,21,1,21,1,1,1,21,1,21,31,32,1,21,255,1,6,21,1,1,1,21,21,21,1,21,1,21,1,1,16,15,16
4154   BBC9 151501150101011501151F200115FF010615010101151515011501150101100F
4154   BBE9 10
4155   BBEA                    defb 1,1,21,1,31,32,1,1,21,1,16,15,16,16,255,1,5,21,255,1,6,13,1,1,1,18,17,16,17,31,32,17,17
4155   BBEA 010115011F2001011501100F1010FF010515FF01060D010101121110111F2011
4155   BC0A 11
4156   BC0B                    defb 16,14,255,1,4,18,17,17,16,17,17,1,1,1,21,1,12,255,1,8,31,32,35,255,1,4,19,19,255,1,7,18,17
4156   BC0B 100EFF010412111110111101010115010CFF01081F2023FF01041313FF010712
4156   BC2B 11
4157   BC2C                    defb 1,1,1,12,255,1,6,19,1,31,32,35,255,1,9,19,255,1,5,18,17,1,21,10,1,1,1,19,1,1,1,31,32
4157   BC2C 0101010CFF010613011F2023FF010913FF0105121101150A010101130101011F
4157   BC4C 20
4158   BC4D                    defb 35,1,1,19,255,1,5,19,255,1,8,21,1,21,11,1,19,1,1,1,22,23,24,22,255,1,6,20,255,1,6,19,255,1,4
4158   BC4D 23010113FF010513FF01081501150B011301010116171816FF010614FF010613
4158   BC6D FF0104
4159   BC70                    defb 21,1,12,1,1,19,1,1,25,27,28,25,35,255,1,19,12,255,1,5,26,29,30,26,35,255,1,14,20,1,1,21,1,1
4159   BC70 15010C0101130101191B1C1923FF01130CFF01051A1D1E1A23FF010E14010115
4159   BC90 0101
4160   BC92                    defb 11,255,1,4,22,23,24,22,35,1,1,19,19,1,22,23,24,22,255,1,7,21,1,1,21,12,255,1,5,255,35,4,1
4160   BC92 0BFF01041617181623010113130116171816FF0107150101150CFF0105FF2304
4160   BCB2 01
4161   BCB3                    defb 19,1,19,1,25,27,28,25,255,33,7,21,1,1,1,12,1,1,1,20,255,1,10,26,29,30,26,255,34,7,1,21,1,1
4161   BCB3 13011301191B1C19FF2107150101010C01010114FF010A1A1D1E1AFF22070115
4161   BCD3 0101
4162   BCD5                    defb 12,255,1,14,22,23,24,22,255,35,7,255,1,4,14,1,1,19,255,1,12,255,35,4,255,1,9,13,255,1,9,19,255,1,12
4162   BCD5 0CFF010E16171816FF2307FF01040E010113FF010CFF2304FF01090DFF010913
4162   BCF5 FF010C
4163   BCF8                    defb 19,1,19,1,1,1,12,255,1,15,19,1,1,1,20,255,1,6,19,21,1,14,19,255,1,6,20,255,1,9,19,1,1
4163   BCF8 1301130101010CFF010F1301010114FF01061315010E13FF010614FF01091301
4163   BD18 01
4164   BD19                    defb 19,255,1,7,12,255,1,4,19,255,1,14,19,19,1,1,1,20,255,1,4,12,255,1,9,19,255,1,5,5,8,8,10
4164   BD19 13FF01070CFF010413FF010E131301010114FF01040CFF010913FF0105050808
4164   BD39 0A
4165   BD3A                    defb 1,1,19,255,1,6,21,1,11,255,1,9,19,255,1,4,4,21,21,1,11,255,1,5,19,1,1,21,1,12,255,1,6
4165   BD3A 010113FF010615010BFF010913FF0104041515010BFF010513010115010CFF01
4165   BD5A 06
4166   BD5B                    defb 19,255,1,7,4,21,1,1,12,255,1,9,21,12,1,1,1,19,1,19,1,19,255,1,6,4,1,21,1,12,1,1,1
4166   BD5B 13FF0107041501010CFF0109150C0101011301130113FF0106040115010C0101
4166   BD7B 01
4167   BD7C 13 FF 01 04        defb 19,255,1,4
4168   BD80                    defb 21,21,1,21,255,1,6,21,1,21,255,1,4,21,1,21,255,1,4,21,1,1,1,21,1,21,255,1,5,16,17,16,17
4168   BD80 15150115FF0106150115FF0104150115FF010415010101150115FF0105101110
4168   BDA0 11
4169   BDA1                    defb 1,1,1,21,1,13,8,3,21,1,21,1,21,1,1,1,21,255,1,4,21,1,1,1,14,255,1,4,18,16,16,15,14
4169   BDA1 01010115010D0803150115011501010115FF0104150101010EFF01041210100F
4169   BDC1 0E
4170   BDC2                    defb 1,1,1,4,21,255,1,5,21,255,1,7,16,13,255,1,4,19,255,1,6,19,1,11,1,1,21,255,1,5,15,15,16
4170   BDC2 0101010415FF010515FF0107100DFF010413FF010613010B010115FF01050F0F
4170   BDE2 10
4171   BDE3                    defb 15,15,14,1,1,19,255,1,11,19,1,4,255,1,5,15,14,255,1,17,19,255,1,4,18,15,16,16,15,14,1,1,19
4171   BDE3 0F0F0E010113FF010B130104FF01050F0EFF011113FF0104120F10100F0E0101
4171   BE03 13
4172   BE04                    defb 1,1,19,1,1,1,19,255,1,4,19,255,1,6,20,255,1,16,19,1,1,1,20,1,1,19,19,255,1,6,19,255,1,5
4172   BE04 01011301010113FF010413FF010614FF0110130101011401011313FF010613FF
4172   BE24 0105
4173   BE26                    defb 19,1,20,1,1,19,1,1,19,19,255,1,7,19,19,1,1,1,19,19,255,1,10,19,255,1,6,22,23,24,22,255,1,8
4173   BE26 13011401011301011313FF010713130101011313FF010A13FF010616171816FF
4173   BE46 0108
4174   BE48                    defb 19,255,1,12,255,33,5,25,2,2,25,255,33,21,255,34,5,26,2,2,26,255,34,21,255,35,5,22,23,24,22,255,35,17
4174   BE48 13FF010CFF210519020219FF2115FF22051A02021AFF2215FF230516171816FF
4174   BE68 2311
4175   BE6A                    defb 4,21,1,21,255,1,6,31,32,35,35,1,19,255,1,14,4,21,255,1,6,19,1,31,32,35,1,1,1,19,255,1,5
4175   BE6A 04150115FF01061F2023230113FF010E0415FF010613011F202301010113FF01
4175   BE8A 05
4176   BE8B                    defb 19,1,1,1,20,1,19,1,3,1,21,1,1,19,1,1,1,19,31,32,35,255,1,16,19,1,3,1,21,1,1,1,20
4176   BE8B 1301010114011301030115010113010101131F2023FF01101301030115010101
4176   BEAB 14
4177   BEAC                    defb 1,1,31,32,35,255,1,5,19,255,1,9,19,1,1,1,4,255,1,7,31,32,35,1,1,1,19,19,255,1,14,3,15
4177   BEAC 01011F2023FF010513FF01091301010104FF01071F20230101011313FF010E03
4177   BECC 0F
4178   BECD                    defb 1,1,19,1,1,1,31,32,35,1,1,19,1,1,19,1,1,1,20,255,1,11,19,1,1,19,1,1,31,32,35,255,1,12
4178   BECD 0101130101011F202301011301011301010114FF010B1301011301011F2023FF
4178   BEED 010C
4179   BEEF                    defb 19,255,1,10,19,1,1,1,31,32,35,255,1,17,19,255,1,9,31,32,35,1,1,1,19,1,1,1,19,255,1,7,19,19
4179   BEEF 13FF010A130101011F2023FF011113FF01091F20230101011301010113FF0107
4179   BF0F 1313
4180   BF11 FF 01 04           defb 255,1,4
4181   BF14                    defb 1,1,19,1,1,1,4,21,1,1,12,1,1,19,19,255,1,5,4,1,21,255,1,4,21,1,1,19,19,255,1,4,4
4181   BF14 010113010101041501010C01011313FF0105040115FF01041501011313FF0104
4181   BF34 04
4182   BF35                    defb 21,21,1,12,1,19,255,1,7,4,21,1,1,1,21,21,1,21,1,1,19,19,1,1,1,3,1,1,21,12,255,1,4
4182   BF35 1515010C0113FF010704150101011515011501011313010101030101150CFF01
4182   BF55 04
4183   BF56                    defb 19,255,1,4,3,21,1,21,1,1,21,255,1,10,4,21,1,12,1,1,20,255,1,7,4,21,255,1,4,21,255,1,9
4183   BF56 13FF010403150115010115FF010A0415010C010114FF01070415FF010415FF01
4183   BF76 09
4184   BF77                    defb 3,1,1,14,255,1,4,19,1,1,19,1,1,3,1,1,21,255,1,9,19,1,1,1,4,12,255,1,7,19,255,1,4
4184   BF77 0301010EFF010413010113010103010115FF010913010101040CFF010713FF01
4184   BF97 04
4185   BF98                    defb 3,21,255,1,6,19,1,20,255,1,5,4,12,1,1,19,255,1,4,19,255,1,5,3,16,1,21,255,1,4,19,1,1,1
4185   BF98 0315FF0106130114FF0105040C010113FF010413FF010503100115FF01041301
4185   BFB8 0101
4186   BFBA                    defb 19,1,1,18,13,1,1,1,19,255,1,6,20,255,1,4,3,16,15,16,16,1,19,255,1,14,19,19,255,1,10,19,255,1,4
4186   BFBA 130101120D01010113FF010614FF010403100F10100113FF010E1313FF010A13
4186   BFDA FF0104
4187   BFDD                    defb 19,255,1,19,19,255,1,5,19,255,1,6,19,255,1,4,19,255,1,13,19,255,1,9,19,1,19,255,1,8,20,255,1,5
4187   BFDD 13FF011313FF010513FF010613FF010413FF010D13FF0109130113FF010814FF
4187   BFFD 0105
4188   BFFF                    defb 19,255,1,4,7,255,8,4,10,255,1,11,19,1,1,1,19,255,1,6,5,8,21,21,1,21,21,21,9,8,8,9,8
4188   BFFF 13FF010407FF08040AFF010B1301010113FF0106050815150115151509080809
4188   C01F 08
4189   C020                    defb 22,23,24,22,1,1,1,19,255,1,9,4,21,1,1,21,1,21,1,1,21,1,21,1,25,27,28,25,255,33,18,1,1
4189   C020 1617181601010113FF010904150101150115010115011501191B1C19FF211201
4189   C040 01
4190   C041                    defb 21,1,1,21,1,1,26,29,30,26,255,34,18,21,255,1,7,22,23,24,22,255,35,18,255,1,4,21,1,1,21,1,12
4190   C041 1501011501011A1D1E1AFF221215FF010716171816FF2312FF01041501011501
4190   C061 0C
4191   C062                    defb 35,35,35,255,1,5,19,255,1,8,19,255,1,11,12,255,1,4,19,1,19,255,1,8,20,255,1,4,16,17,21,255,1,7
4191   C062 232323FF010513FF010813FF010B0CFF0104130113FF010814FF0104101115FF
4191   C082 0107
4192   C084                    defb 11,255,1,4,19,255,1,4,19,255,1,8,19,1,1,4,21,1,21,255,1,4,12,1,19,1,19,1,1,1,20,255,1,9
4192   C084 0BFF010413FF010413FF010813010104150115FF01040C0113011301010114FF
4192   C0A4 0109
4193   C0A6                    defb 19,1,1,1,4,21,21,1,1,21,1,1,12,255,1,4,19,255,1,7,19,255,1,6
4193   C0A6 1301010104151501011501010CFF010413FF010713FF0106
4194   C0BE                    defb 21,1,21,255,1,8,21,255,1,4,21,1,1,1,21,1,31,32,1,21,255,1,5,21,1,1,21,1,1,16,17,16,255,1,5
4194   C0BE 150115FF010815FF01041501010115011F200115FF0105150101150101101110
4194   C0DE FF0105
4195   C0E1                    defb 21,1,21,21,1,1,1,31,32,21,1,1,6,7,8,1,1,1,15,16,15,14,1,1,1,18,16,255,1,7,21,1,1
4195   C0E1 150115150101011F201501010607080101010F100F0E0101011210FF01071501
4195   C101 01
4196   C102                    defb 31,32,1,1,5,21,21,1,16,15,14,1,1,1,19,255,1,5,18,15,16,255,1,5,16,15,31,32,1,1,4,21,1
4196   C102 1F20010105151501100F0E01010113FF0105120F10FF0105100F1F2001010415
4196   C122 01
4197   C123                    defb 21,1,19,1,1,20,255,1,8,19,1,4,1,15,15,14,1,1,31,32,1,1,3,255,1,5,19,255,1,6,19,255,1,5
4197   C123 150113010114FF0108130104010F0F0E01011F20010103FF010513FF010613FF
4197   C143 0105
4198   C145                    defb 18,14,255,1,4,19,31,32,21,1,1,4,21,1,19,19,1,1,1,19,1,1,19,1,19,255,1,4,20,1,1,19,1,1,1
4198   C145 120EFF0104131F201501010415011313010101130101130113FF010414010113
4198   C165 010101
4199   C168                    defb 31,32,1,21,1,18,17,1,19,255,1,13,19,255,1,5,19,1,31,32,1,1,1,21,1,18,1,1,1,19,255,1,6
4199   C168 1F2001150112110113FF010D13FF010513011F2001010115011201010113FF01
4199   C188 06
4200   C189                    defb 20,1,1,19,255,1,8,31,32,1,21,255,1,11,19,255,1,9,19,1,1,1,22,23,24,22,255,1,5,255,33,21,25
4200   C189 14010113FF01081F200115FF010B13FF01091301010116171816FF0105FF2115
4200   C1A9 19
4201   C1AA                    defb 2,2,25,255,1,5,255,34,21,26,2,2,26,1,21,21,21,1,1,21,1,1,1,21,1,1,21,1,21,1,1,13,255,35,7
4201   C1AA 020219FF0105FF22151A02021A0115151501011501010115010115011501010D
4201   C1CA FF2307
4202   C1CD                    defb 22,23,24,22,1,1,21,1,1,21,1,21,1,1,1,21,1,1,21,1,1,12,1,1,19,1,20,255,1,4,31,32,21
4202   C1CD 1617181601011501011501150101011501011501010C0101130114FF01041F20
4202   C1ED 15
4203   C1EE                    defb 1,1,1,21,255,1,10,21,21,1,12,255,1,9,31,32,1,1,6,10,255,1,4,21,255,1,4,21,255,1,4,13,255,1,6
4203   C1EE 01010115FF010A1515010CFF01091F200101060AFF010415FF010415FF01040D
4203   C20E FF0106
4204   C211                    defb 19,1,19,31,32,1,5,21,21,11,255,1,5,21,255,1,6,12,1,1,20,255,1,5,19,1,31,32,1,4,21,1,12
4204   C211 1301131F20010515150BFF010515FF01060C010114FF010513011F2001041501
4204   C231 0C
4205   C232                    defb 1,15,16,16,15,16,255,1,6,13,255,1,4,19,255,1,5,31,32,1,4,1,16,13,1,1,19,1,1,1,3,21,1,1,1
4205   C232 010F10100F10FF01060DFF010413FF01051F20010401100D0101130101010315
4205   C252 010101
4206   C255                    defb 12,1,1,19,255,1,5,20,1,5,31,32,1,18,14,21,1,1,19,1,19,1,1,1,4,21,1,1,12,255,1,10,4
4206   C255 0C010113FF01051401051F2001120E150101130113010101041501010CFF010A
4206   C275 04
4207   C276                    defb 31,32,255,1,12,4,1,21,1,12,19,255,1,5,19,1,1,5,21,31,32,1,21,1,1,1,21,1,19,1,1,19,1
4207   C276 1F20FF010C040115010C13FF010513010105151F200115010101150113010113
4207   C296 01
4208   C297                    defb 4,21,1,1,12,1,19,1,1,19,255,1,4,4,21,31,32,21,1,21,1,1,1
4208   C297 041501010C0113010113FF010404151F20150115010101
4209   C2AE                    defb 1,1,1,19,1,1,20,1,31,32,35,1,1,19,1,19,1,1,1,4,1,21,255,1,4,21,1,1,1,19,1,20,1
4209   C2AE 01010113010114011F20230101130113010101040115FF010415010101130114
4209   C2CE 01
4210   C2CF                    defb 19,1,1,1,31,32,35,1,1,1,19,255,1,4,3,21,1,21,1,21,1,1,21,255,1,9,19,31,32,35,19,255,1,8
4210   C2CF 130101011F202301010113FF0104031501150115010115FF0109131F202313FF
4210   C2EF 0108
4211   C2F1                    defb 4,21,1,1,1,21,255,1,6,19,255,1,5,31,32,35,1,1,20,1,19,255,1,4,4,21,255,1,5,21,1,21,20
4211   C2F1 041501010115FF010613FF01051F20230101140113FF01040415FF0105150115
4211   C311 14
4212   C312                    defb 255,1,4,19,1,22,23,24,22,255,1,9,3,1,1,21,255,1,4,21,21,255,33,7,25,35,35,25,35,255,1,9,3
4212   C312 FF0104130116171816FF010903010115FF01041515FF21071923231923FF0109
4212   C332 03
4213   C333                    defb 21,1,1,21,255,1,4,255,34,7,26,35,19,26,35,255,1,6,19,1,1,1,3,16,255,1,6,21,1,12,255,35,4
4213   C333 15010115FF0104FF22071A23131A23FF0106130101010310FF010615010CFF23
4213   C353 04
4214   C354                    defb 22,23,24,22,35,1,19,1,1,1,20,1,19,255,1,4,4,1,1,1,21,1,1,21,14,255,1,5,31,32,35,35,255,1,6
4214   C354 16171816230113010101140113FF010404010101150101150EFF01051F202323
4214   C374 FF0106
4215   C377                    defb 19,255,1,4,5,1,21,255,1,5,12,255,1,4,19,1,31,32,35,1,19,255,1,10,4,21,255,1,5,21,12,1,1
4215   C377 13FF0104050115FF01050CFF010413011F20230113FF010A0415FF0105150C01
4215   C397 01
4216   C398                    defb 19,1,1,1,36,37,35,255,1,9,5,8,8,21,1,1,21,255,1,4,12,255,1,7,35,35,255,1,5,19,1,1,1
4216   C398 13010101242523FF010905080815010115FF01040CFF01072323FF0105130101
4216   C3B8 01
4217   C3B9                    defb 4,21,21,1,21,255,1,4,21,1,14,255,1,4,20,255,1,10,19,1,1,3,16,255,1,8,12,255,1,9,19,1,20
4217   C3B9 0415150115FF010415010EFF010414FF010A1301010310FF01080CFF01091301
4217   C3D9 14
4218   C3DA                    defb 255,1,9,4,21,1,1,1,21,1,1,12,255,1,4,19,255,1,7,19,255,1,8,3,16,255,1,7,11,255,1,4,19
4218   C3DA FF010904150101011501010CFF010413FF010713FF01080310FF01070BFF0104
4218   C3FA 13
4219   C3FB                    defb 255,1,5,19,1,19,255,1,4,19,255,1,4,4,21,255,1,5,12,1,19,1,19,255,1,12,19,1,1,1,19,1,4
4219   C3FB FF0105130113FF010413FF01040415FF01050C01130113FF010C130101011301
4219   C41B 04
4220   C41C                    defb 255,1,6,12,1,1,19,255,1,17,5,8,21,255,1,5,21,1,8,11,1,1,19,1,36,37,1,20,1,1,1,7,8,8
4220   C41C FF01060C010113FF0111050815FF01051501080B010113012425011401010107
4220   C43C 0808
4221   C43E                    defb 10,1,19,1,4,21,1,1,1,21,1,21,1,21,1,12,255,1,4,31,32,35,1,7,8,8,21,21,1,12,1,1,1
4221   C43E 0A01130104150101011501150115010CFF01041F2023010708081515010C0101
4221   C45E 01
4222   C45F                    defb 4,1,21,1,1,1,21,255,1,4,21,9,8,8,8,31,32,8,8,21,21,1,1,1,21,1,9,6,5,21,21,255,1,6
4222   C45F 04011501010115FF010415090808081F200808151501010115010906051515FF
4222   C47F 0106
4223   C481                    defb 21,1,1,1,21,21,1,21,31,32,1,21,1,1,21,255,1,7,21,1,1,1,21,1,1,1
4223   C481 15010101151501151F200115010115FF01071501010115010101
4224   C49B                    defb 21,1,21,1,1,21,1,1,1,16,15,16,21,1,1,1,31,32,1,21,1,1,1,16,1,1,1,21,1,1,1,21,1
4224   C49B 150115010115010101100F10150101011F200115010101100101011501010115
4224   C4BB 01
4225   C4BC                    defb 21,1,1,1,15,14,1,19,1,3,15,16,15,31,32,1,1,1,15,14,1,4,1,21,1,21,1,1,21,21,1,1,1
4225   C4BC 150101010F0E011301030F100F1F200101010F0E010401150115010115150101
4225   C4DC 01
4226   C4DD                    defb 12,1,1,19,1,19,255,1,4,31,32,15,15,14,1,1,1,3,21,21,21,1,1,21,255,1,4,15,13,255,1,9,31
4226   C4DD 0C0101130113FF01041F200F0F0E01010103151515010115FF01040F0DFF0109
4226   C4FD 1F
4227   C4FE                    defb 32,35,255,1,4,19,1,3,255,1,5,21,1,1,12,255,1,5,20,1,1,19,1,1,31,32,35,1,19,255,1,5,4
4227   C4FE 2023FF0104130103FF01051501010CFF01051401011301011F20230113FF0105
4227   C51E 04
4228   C51F                    defb 21,255,1,6,13,1,19,1,19,255,1,6,22,23,24,22,255,1,5,20,1,3,255,1,6,13,1,1,19,19,255,1,7
4228   C51F 15FF01060D01130113FF010616171816FF0105140103FF01060D01011313FF01
4228   C53F 07
4229   C540                    defb 25,27,28,25,35,1,1,19,255,1,4,4,1,1,16,15,14,255,1,12,26,29,30,26,35,255,1,6,5,21,1,21,1,1,1
4229   C540 191B1C1923010113FF0104040101100F0EFF010C1A1D1E1A23FF010605150115
4229   C560 010101
4230   C563                    defb 19,255,1,11,22,23,24,22,35,255,1,4,19,1,4,21,21,1,1,1,19,1,1,20,1,1,19,255,1,4,19,1,1
4230   C563 13FF010B1617181623FF0104130104151501010113010114010113FF01041301
4230   C583 01
4231   C584                    defb 255,35,4,255,1,5,19,4,21,255,1,16,19,255,1,11,4,1,1,1,8,9,10,255,1,9,19,255,1,8,19,1,1,1
4231   C584 FF2304FF0105130415FF011013FF010B0401010108090AFF010913FF01081301
4231   C5A4 0101
4232   C5A6                    defb 5,21,1,21,1,21,1,21,9,10,255,1,11,20,1,19,19,255,1,5,4,21,1,1,21,1,21,1,1,12,1,1,22
4232   C5A6 0515011501150115090AFF010B14011313FF01050415010115011501010C0101
4232   C5C6 16
4233   C5C7                    defb 23,24,22,255,1,14,4,1,21,1,1,255,33,7,25,2,2,25,33,33,38,255,1,7,38,255,33,8,255,34,7,26,2,2
4233   C5C7 171816FF010E0401150101FF210719020219212126FF010726FF2108FF22071A
4233   C5E7 0202
4234   C5E9                    defb 26,34,34,39,35,255,1,6,39,255,34,8,255,35,7,22,23,24,22,255,35,4,1,1,19,255,1,4,35,35,4,21,1,1
4234   C5E9 1A22222723FF010627FF2208FF230716171816FF2304010113FF010423230415
4234   C609 0101
4235   C60B                    defb 21,1,1,19,255,1,6,31,32,35,35,255,1,7,20,1,1,1,5,21,1,21,255,1,7,19,1,1,19,31,32,35,1,1
4235   C60B 15010113FF01061F202323FF01071401010105150115FF0107130101131F2023
4235   C62B 0101
4236   C62D                    defb 19,255,1,7,7,8,21,255,1,9,20,255,1,4,31,32,35,255,1,9,7,21,21,1,21,1,1,1,21,1,19,1,19
4236   C62D 13FF0107070815FF010914FF01041F2023FF0109071515011501010115011301
4236   C64D 13
4237   C64E                    defb 1,1,19,1,1,31,32,35,255,1,4,19,1,19,1,7,21,1,1,21,255,1,7,19,1,19,255,1,4,31,32,35,1,1,1
4237   C64E 01011301011F2023FF0104130113010715010115FF0107130113FF01041F2023
4237   C66E 010101
4238   C671                    defb 19,255,1,4,4,21,21,255,1,4,21,1,1,1
4238   C671 13FF0104041515FF010415010101
4239   C67F                    defb 255,0,43,22,23,24,22,255,0,13,38,255,33,12,25,27,28,25,255,33,12,38,39,255,34,12,26,29,30,26,255,34,12
4239   C67F FF002B16171816FF000D26FF210C191B1C19FF210C2627FF220C1A1D1E1AFF22
4239   C69F 0C
4240   C6A0                    defb 39,255,0,13,22,23,24,22,255,0,0,255,0,130,22,23,24,22,255,0,13,38,255,33,12,25,27,28,25,255,33,12,38
4240   C6A0 27FF000D16171816FF0000FF008216171816FF000D26FF210C191B1C19FF210C
4240   C6C0 26
4241   C6C1                    defb 39,255,34,12,26,29,30,26,255,34,12,39,255,0,13,22,23,24,22,255,0,43
4241   C6C1 27FF220C1A1D1E1AFF220C27FF000D16171816FF002B
4242   C6D7 18          numsc  defb 24
4243   C6D8 00008878FF  nmedat defb 0,0,136,120,255
4244   C6DD 00005878FF         defb 0,0,88,120,255
4245   C6E2                    defb 0,0,88,112,1,9,120,56,1,9,40,168,2,8,56,208,255
4245   C6E2 0000587001097838010928A8020838D0FF
4246   C6F3                    defb 0,0,80,112,1,9,72,72,1,9,120,184,255
4246   C6F3 0000507001094848010978B8FF
4247   C700                    defb 0,0,24,120,1,9,56,56,1,9,96,176,255
4247   C700 0000187801093838010960B0FF
4248   C70D                    defb 0,0,16,136,1,9,104,48,1,9,88,176,255
4248   C70D 0000108801096830010958B0FF
4249   C71A                    defb 0,0,80,80,1,9,96,168,1,9,40,80,255
4249   C71A 00005050010960A801092850FF
4250   C727                    defb 0,0,72,112,2,8,56,56,1,9,88,184,1,9,48,128,255
4250   C727 0000487002083838010958B801093080FF
4251   C738                    defb 3,8,72,56,0,0,104,112,1,9,104,88,1,9,48,112,255
4251   C738 03084838000068700109685801093070FF
4252   C749                    defb 0,0,80,120,2,8,128,56,1,9,112,176,1,9,72,88,255
4252   C749 0000507802088038010970B001094858FF
4253   C75A                    defb 0,0,72,24,1,9,80,128,1,9,56,80,255
4253   C75A 000048180109508001093850FF
4254   C767 00005020FF         defb 0,0,80,32,255
4255   C76C                    defb 0,0,112,208,2,8,128,64,1,9,120,128,255
4255   C76C 000070D00208804001097880FF
4256   C779                    defb 0,0,8,88,1,9,112,112,1,9,96,192,255
4256   C779 0000085801097070010960C0FF
4257   C786                    defb 0,0,48,224,1,9,48,64,1,9,120,112,255
4257   C786 000030E00109304001097870FF
4258   C793                    defb 0,0,88,216,1,9,88,72,255
4258   C793 000058D801095848FF
4259   C79C                    defb 0,0,160,96,1,9,96,88,1,9,80,128,255
4259   C79C 0000A0600109605801095080FF
4260   C7A9                    defb 0,0,160,64,1,9,56,136,1,9,48,48,255
4260   C7A9 0000A0400109388801093030FF
4261   C7B6                    defb 0,0,56,16,1,9,128,136,255
4261   C7B6 0000381001098088FF
4262   C7BF                    defb 0,0,40,16,1,9,56,128,1,9,88,152,255
4262   C7BF 000028100109388001095898FF
4263   C7CC                    defb 0,0,64,16,1,9,56,96,1,9,128,136,255
4263   C7CC 000040100109386001098088FF
4264   C7D9                    defb 0,0,16,136,2,8,112,72,1,9,80,120,255
4264   C7D9 000010880208704801095078FF
4265   C7E6                    defb 0,0,72,8,3,8,120,136,1,9,56,96,255
4265   C7E6 000048080308788801093860FF
4266   C7F3             NUMOBJ equ 10
4267   C7F3             objdta equ $
4268   C7F3                    defb 5,160,29,184,48,12,103,230,67,194,209,139,24,24,220,59,220,59,24,24,209,139,67,194,103,230,48,12,29,184,5,160,11,96,72,11,96,72
4268   C7F3 05A01DB8300C67E643C2D18B1818DC3BDC3B1818D18B43C267E6300C1DB805A0
4268   C813 0B60480B6048
4269   C819                    defb 5,160,29,184,48,12,103,230,67,194,209,139,24,24,220,59,220,59,24,24,209,139,67,194,103,230,48,12,29,184,5,160,16,40,144,16,40,144
4269   C819 05A01DB8300C67E643C2D18B1818DC3BDC3B1818D18B43C267E6300C1DB805A0
4269   C839 102890102890
4270   C83F                    defb 5,160,29,184,48,12,103,230,67,194,209,139,24,24,220,59,220,59,24,24,209,139,67,194,103,230,48,12,29,184,5,160,13,56,208,13,56,208
4270   C83F 05A01DB8300C67E643C2D18B1818DC3BDC3B1818D18B43C267E6300C1DB805A0
4270   C85F 0D38D00D38D0
4271   C865                    defb 5,160,29,184,48,12,103,230,67,194,209,139,24,24,220,59,220,59,24,24,209,139,67,194,103,230,48,12,29,184,5,160,18,104,136,18,104,136
4271   C865 05A01DB8300C67E643C2D18B1818DC3BDC3B1818D18B43C267E6300C1DB805A0
4271   C885 126888126888
4272   C88B                    defb 5,160,29,184,48,12,103,230,67,194,209,139,24,24,220,59,220,59,24,24,209,139,67,194,103,230,48,12,29,184,5,160,20,48,160,20,48,160
4272   C88B 05A01DB8300C67E643C2D18B1818DC3BDC3B1818D18B43C267E6300C1DB805A0
4272   C8AB 1430A01430A0
4273   C8B1                    defb 5,160,29,184,48,12,103,230,67,194,209,139,24,24,220,59,220,59,24,24,209,139,67,194,103,230,48,12,29,184,5,160,22,144,48,22,144,48
4273   C8B1 05A01DB8300C67E643C2D18B1818DC3BDC3B1818D18B43C267E6300C1DB805A0
4273   C8D1 169030169030
4274   C8D7                    defb 5,160,29,184,48,12,103,230,67,194,209,139,24,24,220,59,220,59,24,24,209,139,67,194,103,230,48,12,29,184,5,160,21,112,16,21,112,16
4274   C8D7 05A01DB8300C67E643C2D18B1818DC3BDC3B1818D18B43C267E6300C1DB805A0
4274   C8F7 157010157010
4275   C8FD                    defb 5,160,29,184,48,12,103,230,67,194,209,139,24,24,220,59,220,59,24,24,209,139,67,194,103,230,48,12,29,184,5,160,15,88,32,15,88,32
4275   C8FD 05A01DB8300C67E643C2D18B1818DC3BDC3B1818D18B43C267E6300C1DB805A0
4275   C91D 0F58200F5820
4276   C923                    defb 5,160,29,184,48,12,103,230,67,194,209,139,24,24,220,59,220,59,24,24,209,139,67,194,103,230,48,12,29,184,5,160,12,96,32,12,96,32
4276   C923 05A01DB8300C67E643C2D18B1818DC3BDC3B1818D18B43C267E6300C1DB805A0
4276   C943 0C60200C6020
4277   C949                    defb 5,160,29,184,48,12,103,230,67,194,209,139,24,24,220,59,220,59,24,24,209,139,67,194,103,230,48,12,29,184,5,160,14,56,56,14,56,56
4277   C949 05A01DB8300C67E643C2D18B1818DC3BDC3B1818D18B43C267E6300C1DB805A0
4277   C969 0E38380E3838
4278   C96F             palett equ $
4279   C96F                    defb 0,3,28,31,224,227,252,255,0,15,156,30,248,131,190,253
4279   C96F 00031C1FE0E3FCFF000F9C1EF883BEFD
4280   C97F                    defb 0,3,28,31,224,227,252,255,0,15,156,30,248,131,190,253
4280   C97F 00031C1FE0E3FCFF000F9C1EF883BEFD
4281   C98F             font   equ $
4282   C98F                    defb 0,0,0,0,0,0,0,0
4282   C98F 0000000000000000
4283   C997                    defb 0,48,48,48,48,0,48,0
4283   C997 0030303030003000
4284   C99F                    defb 0,108,108,0,0,0,0,0
4284   C99F 006C6C0000000000
4285   C9A7                    defb 0,108,254,108,108,254,108,0
4285   C9A7 006CFE6C6CFE6C00
4286   C9AF                    defb 0,24,126,120,126,30,126,24
4286   C9AF 00187E787E1E7E18
4287   C9B7                    defb 0,230,236,24,48,110,206,0
4287   C9B7 00E6EC18306ECE00
4288   C9BF                    defb 0,48,120,48,126,204,126,0
4288   C9BF 003078307ECC7E00
4289   C9C7                    defb 0,24,48,0,0,0,0,0
4289   C9C7 0018300000000000
4290   C9CF                    defb 0,12,24,24,24,24,12,0
4290   C9CF 000C181818180C00
4291   C9D7                    defb 0,96,48,48,48,48,96,0
4291   C9D7 0060303030306000
4292   C9DF                    defb 0,0,60,24,126,24,60,0
4292   C9DF 00003C187E183C00
4293   C9E7                    defb 0,0,24,24,126,24,24,0
4293   C9E7 000018187E181800
4294   C9EF                    defb 0,0,0,0,0,24,24,48
4294   C9EF 0000000000181830
4295   C9F7                    defb 0,0,0,0,126,0,0,0
4295   C9F7 000000007E000000
4296   C9FF                    defb 0,0,0,0,0,56,56,0
4296   C9FF 0000000000383800
4297   CA07                    defb 0,0,6,12,24,48,96,0
4297   CA07 0000060C18306000
4298   CA0F                    defb 0,124,206,222,246,230,124,0
4298   CA0F 007CCEDEF6E67C00
4299   CA17                    defb 0,56,120,24,24,24,126,0
4299   CA17 0038781818187E00
4300   CA1F                    defb 0,124,198,6,124,192,254,0
4300   CA1F 007CC6067CC0FE00
4301   CA27                    defb 0,124,198,28,6,198,124,0
4301   CA27 007CC61C06C67C00
4302   CA2F                    defb 0,24,56,120,216,254,24,0
4302   CA2F 00183878D8FE1800
4303   CA37                    defb 0,254,192,252,6,198,124,0
4303   CA37 00FEC0FC06C67C00
4304   CA3F                    defb 0,124,192,252,198,198,124,0
4304   CA3F 007CC0FCC6C67C00
4305   CA47                    defb 0,254,6,12,24,48,48,0
4305   CA47 00FE060C18303000
4306   CA4F                    defb 0,124,198,124,198,198,124,0
4306   CA4F 007CC67CC6C67C00
4307   CA57                    defb 0,124,198,198,126,6,124,0
4307   CA57 007CC6C67E067C00
4308   CA5F                    defb 0,0,0,48,0,0,48,0
4308   CA5F 0000003000003000
4309   CA67                    defb 0,0,48,0,0,48,48,96
4309   CA67 0000300000303060
4310   CA6F                    defb 0,0,12,24,48,24,12,0
4310   CA6F 00000C1830180C00
4311   CA77                    defb 0,0,0,126,0,126,0,0
4311   CA77 0000007E007E0000
4312   CA7F                    defb 0,0,48,24,12,24,48,0
4312   CA7F 000030180C183000
4313   CA87                    defb 0,124,198,12,24,0,24,0
4313   CA87 007CC60C18001800
4314   CA8F                    defb 0,124,222,254,254,192,124,0
4314   CA8F 007CDEFEFEC07C00
4315   CA97                    defb 0,124,198,198,254,198,198,0
4315   CA97 007CC6C6FEC6C600
4316   CA9F                    defb 0,252,198,252,198,198,252,0
4316   CA9F 00FCC6FCC6C6FC00
4317   CAA7                    defb 0,124,198,192,192,198,124,0
4317   CAA7 007CC6C0C0C67C00
4318   CAAF                    defb 0,248,204,198,198,204,248,0
4318   CAAF 00F8CCC6C6CCF800
4319   CAB7                    defb 0,254,192,252,192,192,254,0
4319   CAB7 00FEC0FCC0C0FE00
4320   CABF                    defb 0,254,192,252,192,192,192,0
4320   CABF 00FEC0FCC0C0C000
4321   CAC7                    defb 0,124,198,192,222,198,124,0
4321   CAC7 007CC6C0DEC67C00
4322   CACF                    defb 0,198,198,254,198,198,198,0
4322   CACF 00C6C6FEC6C6C600
4323   CAD7                    defb 0,126,24,24,24,24,126,0
4323   CAD7 007E181818187E00
4324   CADF                    defb 0,6,6,6,198,198,124,0
4324   CADF 00060606C6C67C00
4325   CAE7                    defb 0,204,216,240,216,204,198,0
4325   CAE7 00CCD8F0D8CCC600
4326   CAEF                    defb 0,192,192,192,192,192,254,0
4326   CAEF 00C0C0C0C0C0FE00
4327   CAF7                    defb 0,198,238,254,198,198,198,0
4327   CAF7 00C6EEFEC6C6C600
4328   CAFF                    defb 0,198,230,246,222,206,198,0
4328   CAFF 00C6E6F6DECEC600
4329   CB07                    defb 0,124,198,198,198,198,124,0
4329   CB07 007CC6C6C6C67C00
4330   CB0F                    defb 0,252,198,198,252,192,192,0
4330   CB0F 00FCC6C6FCC0C000
4331   CB17                    defb 0,124,198,198,246,222,124,0
4331   CB17 007CC6C6F6DE7C00
4332   CB1F                    defb 0,252,198,198,252,204,198,0
4332   CB1F 00FCC6C6FCCCC600
4333   CB27                    defb 0,124,192,124,6,198,124,0
4333   CB27 007CC07C06C67C00
4334   CB2F                    defb 0,254,48,48,48,48,48,0
4334   CB2F 00FE303030303000
4335   CB37                    defb 0,198,198,198,198,198,124,0
4335   CB37 00C6C6C6C6C67C00
4336   CB3F                    defb 0,198,198,198,198,108,56,0
4336   CB3F 00C6C6C6C66C3800
4337   CB47                    defb 0,198,198,198,198,254,108,0
4337   CB47 00C6C6C6C6FE6C00
4338   CB4F                    defb 0,198,108,56,56,108,198,0
4338   CB4F 00C66C38386CC600
4339   CB57                    defb 0,134,204,120,48,48,48,0
4339   CB57 0086CC7830303000
4340   CB5F                    defb 0,254,12,24,48,96,254,0
4340   CB5F 00FE0C183060FE00
4341   CB67                    defb 0,30,24,24,24,24,30,0
4341   CB67 001E181818181E00
4342   CB6F                    defb 0,0,192,96,48,24,12,0
4342   CB6F 0000C06030180C00
4343   CB77                    defb 0,240,48,48,48,48,240,0
4343   CB77 00F030303030F000
4344   CB7F                    defb 0,48,120,252,48,48,48,0
4344   CB7F 003078FC30303000
4345   CB87                    defb 0,0,0,0,0,0,0,255
4345   CB87 00000000000000FF
4346   CB8F                    defb 0,60,102,248,96,96,254,0
4346   CB8F 003C66F86060FE00
4347   CB97                    defb 0,0,120,12,124,204,124,0
4347   CB97 0000780C7CCC7C00
4348   CB9F                    defb 0,96,96,124,102,102,124,0
4348   CB9F 0060607C66667C00
4349   CBA7                    defb 0,0,60,96,96,96,60,0
4349   CBA7 00003C6060603C00
4350   CBAF                    defb 0,12,12,124,204,204,124,0
4350   CBAF 000C0C7CCCCC7C00
4351   CBB7                    defb 0,0,120,204,248,192,124,0
4351   CBB7 000078CCF8C07C00
4352   CBBF                    defb 0,28,48,56,48,48,48,0
4352   CBBF 001C303830303000
4353   CBC7                    defb 0,0,124,204,204,124,12,120
4353   CBC7 00007CCCCC7C0C78
4354   CBCF                    defb 0,192,192,248,204,204,204,0
4354   CBCF 00C0C0F8CCCCCC00
4355   CBD7                    defb 0,48,0,112,48,48,120,0
4355   CBD7 0030007030307800
4356   CBDF                    defb 0,12,0,12,12,12,108,56
4356   CBDF 000C000C0C0C6C38
4357   CBE7                    defb 0,96,120,112,112,120,108,0
4357   CBE7 0060787070786C00
4358   CBEF                    defb 0,48,48,48,48,48,28,0
4358   CBEF 0030303030301C00
4359   CBF7                    defb 0,0,248,252,252,252,252,0
4359   CBF7 0000F8FCFCFCFC00
4360   CBFF                    defb 0,0,248,204,204,204,204,0
4360   CBFF 0000F8CCCCCCCC00
4361   CC07                    defb 0,0,120,204,204,204,120,0
4361   CC07 000078CCCCCC7800
4362   CC0F                    defb 0,0,248,204,204,248,192,192
4362   CC0F 0000F8CCCCF8C0C0
4363   CC17                    defb 0,0,124,204,204,124,12,14
4363   CC17 00007CCCCC7C0C0E
4364   CC1F                    defb 0,0,60,96,96,96,96,0
4364   CC1F 00003C6060606000
4365   CC27                    defb 0,0,120,192,120,12,248,0
4365   CC27 000078C0780CF800
4366   CC2F                    defb 0,48,120,48,48,48,28,0
4366   CC2F 0030783030301C00
4367   CC37                    defb 0,0,204,204,204,204,120,0
4367   CC37 0000CCCCCCCC7800
4368   CC3F                    defb 0,0,204,204,120,120,48,0
4368   CC3F 0000CCCC78783000
4369   CC47                    defb 0,0,204,252,252,252,120,0
4369   CC47 0000CCFCFCFC7800
4370   CC4F                    defb 0,0,204,120,48,120,204,0
4370   CC4F 0000CC783078CC00
4371   CC57                    defb 0,0,204,204,204,124,12,120
4371   CC57 0000CCCCCC7C0C78
4372   CC5F                    defb 0,0,252,24,48,96,252,0
4372   CC5F 0000FC183060FC00
4373   CC67                    defb 0,30,24,112,24,24,30,0
4373   CC67 001E187018181E00
4374   CC6F                    defb 0,24,24,24,24,24,24,0
4374   CC6F 0018181818181800
4375   CC77                    defb 0,240,48,28,48,48,240,0
4375   CC77 00F0301C3030F000
4376   CC7F                    defb 0,60,120,0,0,0,0,0
4376   CC7F 003C780000000000
4377   CC87                    defb 124,198,187,227,227,187,198,124
4377   CC87 7CC6BBE3E3BBC67C
4378   CC8F             jtab   equ $
4379   CC8F 63                 defb 99
4380   CC90             keys   defb 34,26,38,37,16,36,28,36,28,20,12
4380   CC90 221A262510241C241C140C
4381   CC9B CD C7 85    plsnd  call plsnd1
4382   CC9E CD 27 85           call plsnd2
4383   CCA1 CD 52 85           call plsnd3
4384   CCA4 C3 F9 84           jp w8912
4385   CCA7             
